﻿function GetRequest() {
    var url = location.search; //获取url中"?"符后的字串
    var theRequest = new Object();
    if (url.indexOf("?") != -1) {
        var str = url.substr(1);
        strs = str.split("&");
        for (var i = 0; i < strs.length; i++) {
            theRequest[strs[i].split("=")[0]] = decodeURIComponent(strs[i].split("=")[1]);
        }
    }
    return theRequest;
}

var peopleMsg = new Array(9);
var peopleTotalDay = new Array(9);
var peoplePlanDay = new Array(9);
for(var i = 1; i < 9; i++){
    peopleMsg[i] = 0;       //每个工作内容共有多少人 = 总rowspan
    peopleTotalDay[i] = 0;  //总(含税)  = 总rowspan
    peoplePlanDay[i] = 0;   //计划日   = 总rowspan
}
var peopleMoney = new Array(19);
var peopleNum = new Array(19);
var jobTotalDay = new Array(19);
var systemTotalNum = new Array(8);
for(var i = 1; i < 19; i++) {
    peopleMoney[i] = 0;     // = 分rowspan
    peopleNum[i] = 0;       // = 分rowspan
    jobTotalDay[i] = 0;
}
for(var i = 0; i < 8; i++) {
    systemTotalNum[i] = 0;
}

var peopleMsg_1_xqfx = 0;
var peopleMsg_1_cpjl = 0;
var peopleMsg_2_cpjl = 0;
var peopleMsg_2_yyjg = 0;
var peopleMsg_2_jcpt = 0;
var peopleMsg_2_khd = 0;
var peopleMsg_2_qd = 0;
var peopleMsg_2_ui = 0;
var peopleMsg_3_java = 0;
var peopleMsg_3_az = 0;
var peopleMsg_3_pg = 0;
var peopleMsg_3_c = 0;
var peopleMsg_3_qd = 0;
var allMsg;
var system2job;
var system2fun;
var projectName;
var data;
layui.use(['form','code','laydate'], function(){
    var laydate = layui.laydate;
    //执行一个laydate实例
    laydate.render({
        elem: '#deadline' //指定元素
    });
    form = layui.form;
    layui.code();
    $('#site').xcity('','','');
    var a=GetRequest();
    var tableid = a['tableId'];
    //初始化:接收数据
    //alert(tableid);
    if(tableid){
        $.ajax({
            url: "/contract/show",   //有tableId说明已经插入过了
            type: "get",
            dateType: "json",
            data:{
                    level1SystemId: tableid
                },
            success: function(res) {
                console.log(res);
                if(res.msg == 'success') {
                    data = res.data;
                    layer.msg("加载数据成功...")
                    allMsg = res.data.WorkPlan;
                    system2job = res.data.System2job;
                    system2fun = res.data.System2fun;
                    projectName = res.data.System1.projectName;
                    form.val('firstTable', {
                        "tableId": res.data.System1.level1SystemId,
                        "modeId": res.data.System1.modeId,
                        "projectName": res.data.System1.projectName,
                        "businessName": res.data.System1.customerName,
                        "chiefName": res.data.System1.headName,
                        "chiefPhone": res.data.System1.headPhone,
                        "chiefEmail": res.data.System1.headEmail,
                        "deadline": res.data.System1.deliveryTime,
                        "content": res.data.System1.deliverables,
                        "method": res.data.System1.deliveryWay,
                        "street": res.data.System1.deliveryPlace
                    });
                    for(let i = 0; i < allMsg.length; i++){
                        switch(res.data.WorkPlan[i].typeId){
                            case 1 : {
                                peopleMsg[1]++;
                                peoplePlanDay[1] += res.data.WorkPlan[i].planDay;
                                peopleTotalDay[1] += res.data.WorkPlan[i].totalDay;
                                switch(res.data.WorkPlan[i].site){
                                    case 1 : {
                                        peopleMsg_1_cpjl++;
                                        peopleMoney[1]=res.data.WorkPlan[i].money;
                                        peopleNum[1]=res.data.WorkPlan[i].num;
                                    }; break;
                                    case 2 : {peopleMsg_1_xqfx++; peopleMoney[2]=res.data.WorkPlan[i].money; peopleNum[2]=res.data.WorkPlan[i].num}; break;
                                }
                            }; break;
                            case 2 : {
                                peopleMsg[2]++;
                                peoplePlanDay[2] += res.data.WorkPlan[i].planDay;
                                peopleTotalDay[2] += res.data.WorkPlan[i].totalDay;
                                switch(res.data.WorkPlan[i].site){
                                    case 1 : {peopleMsg_2_cpjl++; peopleMoney[3]=res.data.WorkPlan[i].money; peopleNum[3]=res.data.WorkPlan[i].num}; break;
                                    case 3 : {peopleMsg_2_yyjg++; peopleMoney[4]=res.data.WorkPlan[i].money; peopleNum[4]=res.data.WorkPlan[i].num}; break;
                                    case 4 : {peopleMsg_2_jcpt++; peopleMoney[5]=res.data.WorkPlan[i].money; peopleNum[5]=res.data.WorkPlan[i].num}; break;
                                    case 5 : {peopleMsg_2_khd++;  peopleMoney[6]=res.data.WorkPlan[i].money; peopleNum[6]=res.data.WorkPlan[i].num}; break;
                                    case 6 : {peopleMsg_2_qd++;   peopleMoney[7]=res.data.WorkPlan[i].money; peopleNum[7]=res.data.WorkPlan[i].num}; break;
                                    case 7 : {peopleMsg_2_ui++;   peopleMoney[8]=res.data.WorkPlan[i].money; peopleNum[8]=res.data.WorkPlan[i].num}; break;
                                }
                            }; break;
                            case 3 : {
                                peopleMsg[3]++;
                                peoplePlanDay[3] += res.data.WorkPlan[i].planDay;
                                peopleTotalDay[3] += res.data.WorkPlan[i].totalDay;
                                switch(res.data.WorkPlan[i].site){
                                    case 8  : {peopleMsg_3_java++; peopleMoney[9]=res.data.WorkPlan[i].money;  peopleNum[9]=res.data.WorkPlan[i].num}; break;
                                    case 9  : {peopleMsg_3_az++;   peopleMoney[10]=res.data.WorkPlan[i].money; peopleNum[10]=res.data.WorkPlan[i].num}; break;
                                    case 10 : {peopleMsg_3_pg++;   peopleMoney[11]=res.data.WorkPlan[i].money; peopleNum[11]=res.data.WorkPlan[i].num}; break;
                                    case 11 : {peopleMsg_3_c++;    peopleMoney[12]=res.data.WorkPlan[i].money; peopleNum[12]=res.data.WorkPlan[i].num}; break;
                                    case 12 : {peopleMsg_3_qd++;   peopleMoney[13]=res.data.WorkPlan[i].money; peopleNum[13]=res.data.WorkPlan[i].num}; break;
                                }
                            }; break;
                            case 4 : {
                                peopleMsg[4]++;
                                peopleNum[14]=res.data.WorkPlan[i].num;
                                peoplePlanDay[4] += res.data.WorkPlan[i].planDay;
                                peopleTotalDay[4] += res.data.WorkPlan[i].totalDay;
                                peopleMoney[14]=res.data.WorkPlan[i].money;
                            }; break;
                            case 5 : {
                                peopleMsg[5]++;
                                peopleNum[15]=res.data.WorkPlan[i].num;
                                peoplePlanDay[5] += res.data.WorkPlan[i].planDay;
                                peopleTotalDay[5] += res.data.WorkPlan[i].totalDay;
                                peopleMoney[15]=res.data.WorkPlan[i].money;
                            }; break;
                            case 6 : {
                                peopleMsg[6]++;
                                peopleNum[16]=res.data.WorkPlan[i].num;
                                peoplePlanDay[6] += res.data.WorkPlan[i].planDay;
                                peopleTotalDay[6] += res.data.WorkPlan[i].totalDay;
                                peopleMoney[16]=res.data.WorkPlan[i].money;
                            }; break;
                            case 7 : {
                                peopleMsg[7]++;
                                peopleNum[17]=res.data.WorkPlan[i].num;
                                peoplePlanDay[7] += res.data.WorkPlan[i].planDay;
                                peopleTotalDay[7] += res.data.WorkPlan[i].totalDay;
                                peopleMoney[17]=res.data.WorkPlan[i].money;
                            }; break;
                            case 8 : {
                                peopleMsg[8]++;
                                peopleNum[18]=res.data.WorkPlan[i].num;
                                peoplePlanDay[8] += res.data.WorkPlan[i].planDay;
                                peopleTotalDay[8] += res.data.WorkPlan[i].totalDay;
                                peopleMoney[18]=res.data.WorkPlan[i].money;
                            }; break;
                        }
                    }
                    var num = 0;
                    for(var i = 1; i < 9; i++){ //遍历一下json数据
                        if(peopleMsg[i] > 0)
                            var trow = getDataRow(i, num); //定义一个方法,返回tr数据  
                        num += peopleMsg[i];
                        //tbody.appendChild(trow);  
                    }
                    getDataRow2(1, system2job.s1, system2fun.s1);
                    getDataRow2(2, system2job.s2, system2fun.s2);
                    getDataRow2(3, system2job.s3, system2fun.s3);
                    getDataRow2(41, system2job.s41, system2fun.s41);
                    getDataRow2(42, system2job.s42, system2fun.s42);
                    getDataRow2(43, system2job.s43, system2fun.s43);
                    getDataRow2(44, system2job.s44, system2fun.s44);
                    getDataRow2(45, system2job.s45, system2fun.s45);
                } else {
                    alert("加载数据失败..");
                }
            }
        });
    }
});


function isEmpty(val){
    if(val == 'null' || val == null || val == 'undefined' || val == ''){
        return '';
    } else {
        return val;
    }
}

function returnValue(val){
    if(val == ''){
        return 0;
    } else {
        return val;
    }
}

function returnBlank(val){
    if(val == '0' || val == 0){
        return '';
    } else {
        return val;
    }
}

function getDataRow(site, startNum){
    var rowSum = document.createElement('tr'); //创建行  
    var sumCell_1 = document.createElement('td');
    var sumCell_2 = document.createElement('td');
    var sumCell_3 = document.createElement('td');
    var sumCell_4 = document.createElement('td');
    var sumCell_5 = document.createElement('td');
    var sumCell_6 = document.createElement('td');
    var sumCell_7 = document.createElement('td');
    var sumCell_8 = document.createElement('td');
    var sumCell_9 = document.createElement('td');
    var sumCell_10 = document.createElement('td');
    var sumCell_11 = document.createElement('td');
    var s_index = startNum;    //从data[index]开始遍历
    var countMoney = 0; //合计
    var money = new Array();    //单价
    var num = new Array();      //人数
    var totalMoney = new Array();   //小计
    var planDay = new Array();  //计划人日(人数计算)
    var totalDay = new Array();  //含税人日(人数计算)
    var name = new Array(); //姓名(人数计算)
    var countNumPerJob = 0;
    var i = 0;
    var k = 0;
    var flag = 0;   //是否设置了总工作内容
    var jobText = new Array();
    jobText.push("", "产品经理", "需求分析师", "产品经理", "应用架构师", "基础平台设计师", "客户端（app）设计师",
        "前端设计设计师", "UI设计师", "java开发工程师", "安卓开发工程师", "苹果开发工程师", "C#开发工程师",
        "前端开发工程师", "测试工程师", "业务经理", "实施工程师", "项目总监", "技术总监");
    var tbody = document.getElementById('table2');

    switch(site){
        case 1 : {
            if(peopleMsg_1_cpjl > 0) {
                flag = 1;
                money.push(peopleMoney[1]);     //记录每个岗位单价
                num.push(peopleNum[1]);     //记录每个岗位人数
                for(; i < peopleMsg_1_cpjl; i++) {
                    planDay.push(isEmpty(allMsg[s_index].planDay)); //记录每个人的人日
                    totalDay.push(isEmpty(allMsg[s_index].totalDay)); //记录每个人的税日
                    jobTotalDay[1] += returnValue(isEmpty(allMsg[s_index].totalDay));
                    name.push(isEmpty(allMsg[s_index++].name));//记录每个人的姓名
                    countNumPerJob += returnValue(totalDay[i]);
                }
                totalMoney.push(countNumPerJob*returnValue(peopleMoney[1]));   //小计
                k++;
            }
            if(peopleMsg_1_xqfx > 0) {
                if(flag == 0) flag = 2;
                money.push(peopleMoney[2]);
                num.push(peopleNum[2]);
                countNumPerJob = 0;
                for(var f = 0; f < peopleMsg_1_xqfx; f++) {
                    planDay.push(isEmpty(allMsg[s_index].planDay)); //记录每个人的人日
                    totalDay.push(isEmpty(allMsg[s_index].totalDay)); //记录每个人的税日
                    jobTotalDay[2] += returnValue(isEmpty(allMsg[s_index].totalDay));
                    name.push(isEmpty(allMsg[s_index++].name));//记录每个人的姓名
                    countNumPerJob += returnValue(totalDay[i++]);
                }
                totalMoney.push(countNumPerJob*returnValue(peopleMoney[2])); //小计
                k++;
            }
            for(let j = 0; j < k; j++)  {
                countMoney += totalMoney[j];    //合计
            }
            /* 设置总的内容 */
            sumCell_1.innerHTML = '需求调研'; //工作内容
            sumCell_1.style.cssText="font-size: 16px"
            sumCell_1.setAttribute('rowspan', peopleMsg[1]);
            sumCell_2.innerHTML = peoplePlanDay[1]; //计划日
            //sumCell_2.style.cssText="font-size: 16px"
            sumCell_2.setAttribute('rowspan', peopleMsg[1]);
            sumCell_3.innerHTML = peopleTotalDay[1]; //含税日
            //sumCell_3.style.cssText="font-size: 16px"
            sumCell_3.setAttribute('rowspan', peopleMsg[1]);
            sumCell_4.innerHTML = '<button type="button" class="layui-btn layui-btn-lg btn-checked">' + jobText[flag] + '</button>'; //岗位
            sumCell_4.setAttribute('rowspan', peopleNum[flag]);
            sumCell_5.innerHTML = isEmpty(peopleMoney[flag]);   //岗位单价
            sumCell_5.setAttribute('rowspan', peopleNum[flag]);
            sumCell_6.innerHTML = peopleNum[flag];   //岗位人数
            sumCell_6.setAttribute('rowspan', peopleNum[flag]);
            sumCell_7.innerHTML = name[0];   //第一个人名
            sumCell_8.innerHTML = planDay[0];   //第一个人日
            sumCell_9.innerHTML = totalDay[0];   //第一个税日
            sumCell_10.innerHTML = returnBlank(totalMoney[0]); //小计
            sumCell_10.setAttribute('rowspan', peopleNum[flag]);
            sumCell_11.innerHTML = returnBlank(countMoney);   //合计
            sumCell_11.setAttribute('rowspan', peopleMsg[1]);
            //sumCell_11.style.cssText="font-size: 16px"
            rowSum.appendChild(sumCell_1);
            rowSum.appendChild(sumCell_2)
            rowSum.appendChild(sumCell_3)
            rowSum.appendChild(sumCell_4)
            rowSum.appendChild(sumCell_5)
            rowSum.appendChild(sumCell_6)
            rowSum.appendChild(sumCell_7)
            rowSum.appendChild(sumCell_8)
            rowSum.appendChild(sumCell_9)
            rowSum.appendChild(sumCell_10)
            rowSum.appendChild(sumCell_11);
            tbody.appendChild(rowSum);

            let m = 1;
            for(; m < peopleMsg_1_cpjl; m++) {  //第二个人开始
                var row = document.createElement('tr'); //创建行 
                var sumCell_1 = document.createElement('td');
                var sumCell_2 = document.createElement('td');
                var sumCell_3 = document.createElement('td');
                sumCell_1.innerHTML = name[m]; //个人姓名
                sumCell_2.innerHTML = planDay[m]; //个人计划日
                sumCell_3.innerHTML = totalDay[m]; //个人含税日
                row.appendChild(sumCell_1)
                row.appendChild(sumCell_2)
                row.appendChild(sumCell_3);
                tbody.appendChild(row);
            }
            if(flag == 2) { //产品经理无数据(总的标记从2开始)
                for(; m < peopleMsg_1_xqfx; m++) {  //第二个人开始
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            } else {    //产品经理有数据
                if(peopleMsg_1_xqfx > 0) {  //需求分析师有数据
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    var sumCell_4 = document.createElement('td');
                    var sumCell_5 = document.createElement('td');
                    var sumCell_6 = document.createElement('td');
                    var sumCell_7 = document.createElement('td');
                    sumCell_1.innerHTML = '<button type="button" class="layui-btn layui-btn-lg btn-checked">需求分析师</button>'; //岗位
                    sumCell_1.setAttribute('rowspan', peopleNum[2]);
                    sumCell_2.innerHTML = isEmpty(peopleMoney[2]);   //岗位单价
                    sumCell_2.setAttribute('rowspan', peopleNum[2]);
                    sumCell_3.innerHTML = peopleNum[2];   //岗位人数
                    sumCell_3.setAttribute('rowspan', peopleNum[2]);
                    sumCell_4.innerHTML = name[m];   //第一个人名
                    sumCell_5.innerHTML = planDay[m];   //第一个人日
                    sumCell_6.innerHTML = totalDay[m++];   //第一个税日
                    sumCell_7.innerHTML = totalMoney[1]; //小计
                    sumCell_7.setAttribute('rowspan', peopleNum[2]);
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3)
                    row.appendChild(sumCell_4)
                    row.appendChild(sumCell_5)
                    row.appendChild(sumCell_6)
                    row.appendChild(sumCell_7)
                    tbody.appendChild(row);
                }
                for(let n = 1; n < peopleMsg_1_xqfx; n++) {
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m++]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            }
        }; break;

        case 2 : {
            if(peopleMsg_2_cpjl > 0) {
                flag = 3;
                money.push(peopleMoney[3]);     //记录每个岗位单价
                num.push(peopleNum[3]);     //记录每个岗位人数
                for(; i < peopleMsg_2_cpjl; i++) {
                    planDay.push(isEmpty(allMsg[s_index].planDay)); //记录每个人的人日
                    totalDay.push(isEmpty(allMsg[s_index].totalDay)); //记录每个人的税日
                    jobTotalDay[3] += returnValue(isEmpty(allMsg[s_index].totalDay));
                    name.push(isEmpty(allMsg[s_index++].name));//记录每个人的姓名
                    countNumPerJob += returnValue(totalDay[i]);
                }
                totalMoney.push(countNumPerJob*returnValue(peopleMoney[3]));   //小计
                k++;
            }
            if(peopleMsg_2_yyjg > 0) {
                if(flag == 0) flag = 4;
                money.push(peopleMoney[4]);
                num.push(peopleNum[4]);
                countNumPerJob = 0;
                for(var f = 0; f < peopleMsg_2_yyjg; f++) {
                    planDay.push(isEmpty(allMsg[s_index].planDay)); //记录每个人的人日
                    totalDay.push(isEmpty(allMsg[s_index].totalDay)); //记录每个人的税日
                    jobTotalDay[4] += returnValue(isEmpty(allMsg[s_index].totalDay));
                    name.push(isEmpty(allMsg[s_index++].name));//记录每个人的姓名
                    countNumPerJob += returnValue(totalDay[i++]);
                }
                totalMoney.push(countNumPerJob*returnValue(peopleMoney[4])); //小计
                k++;
            }
            if(peopleMsg_2_jcpt > 0) {
                if(flag == 0) flag = 5;
                money.push(peopleMoney[5]);
                num.push(peopleNum[5]);
                countNumPerJob = 0;
                for(var f = 0; f < peopleMsg_2_jcpt; f++) {
                    planDay.push(isEmpty(allMsg[s_index].planDay)); //记录每个人的人日
                    totalDay.push(isEmpty(allMsg[s_index].totalDay)); //记录每个人的税日
                    jobTotalDay[5] += returnValue(isEmpty(allMsg[s_index].totalDay));
                    name.push(isEmpty(allMsg[s_index++].name));//记录每个人的姓名
                    countNumPerJob += returnValue(totalDay[i++]);
                }
                totalMoney.push(countNumPerJob*returnValue(peopleMoney[5])); //小计
                k++;
            }
            if(peopleMsg_2_khd > 0) {
                if(flag == 0) flag = 6;
                money.push(peopleMoney[6]);
                num.push(peopleNum[6]);
                countNumPerJob = 0;
                for(var f = 0; f < peopleMsg_2_khd; f++) {
                    planDay.push(isEmpty(allMsg[s_index].planDay)); //记录每个人的人日
                    totalDay.push(isEmpty(allMsg[s_index].totalDay)); //记录每个人的税日
                    jobTotalDay[6] += returnValue(isEmpty(allMsg[s_index].totalDay));
                    name.push(isEmpty(allMsg[s_index++].name));//记录每个人的姓名
                    countNumPerJob += returnValue(totalDay[i++]);
                }
                totalMoney.push(countNumPerJob*returnValue(peopleMoney[6])); //小计
                k++;
            }
            if(peopleMsg_2_qd > 0) {
                if(flag == 0) flag = 7;
                money.push(peopleMoney[7]);
                num.push(peopleNum[7]);
                countNumPerJob = 0;
                for(var f = 0; f < peopleMsg_2_qd; f++) {
                    planDay.push(isEmpty(allMsg[s_index].planDay)); //记录每个人的人日
                    totalDay.push(isEmpty(allMsg[s_index].totalDay)); //记录每个人的税日
                    jobTotalDay[7] += returnValue(isEmpty(allMsg[s_index].totalDay));
                    name.push(isEmpty(allMsg[s_index++].name));//记录每个人的姓名
                    countNumPerJob += returnValue(totalDay[i++]);
                }
                totalMoney.push(countNumPerJob*returnValue(peopleMoney[7])); //小计
                k++;
            }
            if(peopleMsg_2_ui > 0) {
                if(flag == 0) flag = 8;
                money.push(peopleMoney[8]);
                num.push(peopleNum[8]);
                countNumPerJob = 0;
                for(var f = 0; f < peopleMsg_2_ui; f++) {
                    planDay.push(isEmpty(allMsg[s_index].planDay)); //记录每个人的人日
                    totalDay.push(isEmpty(allMsg[s_index].totalDay)); //记录每个人的税日
                    jobTotalDay[8] += returnValue(isEmpty(allMsg[s_index].totalDay));
                    name.push(isEmpty(allMsg[s_index++].name));//记录每个人的姓名
                    countNumPerJob += returnValue(totalDay[i++]);
                }
                totalMoney.push(countNumPerJob*returnValue(peopleMoney[8])); //小计
                k++;
            }
            for(let j = 0; j < k; j++)  {
                countMoney += totalMoney[j];    //合计
            }
            /* 设置总的内容 */
            sumCell_1.innerHTML = '系统设计'; //工作内容
            sumCell_1.style.cssText="font-size: 16px"
            sumCell_1.setAttribute('rowspan', peopleMsg[2]);
            sumCell_2.innerHTML = peoplePlanDay[2]; //计划日
            sumCell_2.setAttribute('rowspan', peopleMsg[2]);
            sumCell_3.innerHTML = peopleTotalDay[2]; //含税日
            sumCell_3.setAttribute('rowspan', peopleMsg[2]);
            sumCell_4.innerHTML = '<button type="button" class="layui-btn layui-btn-lg btn-checked">' + jobText[flag] + '</button>'; //岗位
            sumCell_4.setAttribute('rowspan', peopleNum[flag]);
            sumCell_5.innerHTML = isEmpty(peopleMoney[flag]);   //岗位单价
            sumCell_5.setAttribute('rowspan', peopleNum[flag]);
            sumCell_6.innerHTML = peopleNum[flag];   //岗位人数
            sumCell_6.setAttribute('rowspan', peopleNum[flag]);
            sumCell_7.innerHTML = name[0];   //第一个人名
            sumCell_8.innerHTML = planDay[0];   //第一个人日
            sumCell_9.innerHTML = totalDay[0];   //第一个税日
            sumCell_10.innerHTML = returnBlank(totalMoney[0]); //小计
            sumCell_10.setAttribute('rowspan', peopleNum[flag]);
            sumCell_11.innerHTML = returnBlank(countMoney);   //合计
            sumCell_11.setAttribute('rowspan', peopleMsg[2]);
            rowSum.appendChild(sumCell_1);
            rowSum.appendChild(sumCell_2)
            rowSum.appendChild(sumCell_3)
            rowSum.appendChild(sumCell_4)
            rowSum.appendChild(sumCell_5)
            rowSum.appendChild(sumCell_6)
            rowSum.appendChild(sumCell_7)
            rowSum.appendChild(sumCell_8)
            rowSum.appendChild(sumCell_9)
            rowSum.appendChild(sumCell_10)
            rowSum.appendChild(sumCell_11);
            tbody.appendChild(rowSum);
            let m = 1;
            let p = 1;
            for(; m < peopleMsg_2_cpjl; m++) {  //第二个人开始
                var row = document.createElement('tr'); //创建行 
                var sumCell_1 = document.createElement('td');
                var sumCell_2 = document.createElement('td');
                var sumCell_3 = document.createElement('td');
                sumCell_1.innerHTML = name[m]; //个人姓名
                sumCell_2.innerHTML = planDay[m]; //个人计划日
                sumCell_3.innerHTML = totalDay[m]; //个人含税日
                row.appendChild(sumCell_1)
                row.appendChild(sumCell_2)
                row.appendChild(sumCell_3);
                tbody.appendChild(row);
            }
            if(flag == 4) { //总的标记从4开始
                for(; m < peopleMsg_2_yyjg; m++) {  //第二个人开始
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            } else if(flag == 3) {    //产品经理有数据
                if(peopleMsg_2_yyjg > 0) {
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    var sumCell_4 = document.createElement('td');
                    var sumCell_5 = document.createElement('td');
                    var sumCell_6 = document.createElement('td');
                    var sumCell_7 = document.createElement('td');
                    sumCell_1.innerHTML = '<button type="button" class="layui-btn layui-btn-lg btn-checked">应用架构设计师</button>'; //岗位
                    sumCell_1.setAttribute('rowspan', peopleNum[4]);
                    sumCell_2.innerHTML = isEmpty(peopleMoney[3]);   //岗位单价
                    sumCell_2.setAttribute('rowspan', peopleNum[4]);
                    sumCell_3.innerHTML = peopleNum[3];   //岗位人数
                    sumCell_3.setAttribute('rowspan', peopleNum[4]);
                    sumCell_4.innerHTML = name[m];   //第一个人名
                    sumCell_5.innerHTML = planDay[m];   //第一个人日
                    sumCell_6.innerHTML = totalDay[m++];   //第一个税日
                    sumCell_7.innerHTML = totalMoney[p++]; //小计
                    sumCell_7.setAttribute('rowspan', peopleNum[4]);
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3)
                    row.appendChild(sumCell_4)
                    row.appendChild(sumCell_5)
                    row.appendChild(sumCell_6)
                    row.appendChild(sumCell_7)
                    tbody.appendChild(row);
                }
                for(let n = 1; n < peopleMsg_2_yyjg; n++) {
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m++]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            }
            if(flag == 5) { //总的标记从5开始
                for(; m < peopleMsg_2_jcpt; m++) {  //第二个人开始
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            } else if(flag == 3 || flag == 4) {
                if(peopleMsg_2_jcpt > 0) {
                    var row = document.createElement('tr');
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    var sumCell_4 = document.createElement('td');
                    var sumCell_5 = document.createElement('td');
                    var sumCell_6 = document.createElement('td');
                    var sumCell_7 = document.createElement('td');
                    sumCell_1.innerHTML = '<button type="button" class="layui-btn layui-btn-lg btn-checked">基础平台设计师</button>'; //岗位
                    sumCell_1.setAttribute('rowspan', peopleNum[5]);
                    sumCell_2.innerHTML = isEmpty(peopleMoney[5]);   //岗位单价
                    sumCell_2.setAttribute('rowspan', peopleNum[5]);
                    sumCell_3.innerHTML = peopleNum[5];   //岗位人数
                    sumCell_3.setAttribute('rowspan', peopleNum[5]);
                    sumCell_4.innerHTML = name[m];   //第一个人名
                    sumCell_5.innerHTML = planDay[m];   //第一个人日
                    sumCell_6.innerHTML = totalDay[m++];   //第一个税日
                    sumCell_7.innerHTML = totalMoney[p++]; //小计
                    sumCell_7.setAttribute('rowspan', peopleNum[5]);
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3)
                    row.appendChild(sumCell_4)
                    row.appendChild(sumCell_5)
                    row.appendChild(sumCell_6)
                    row.appendChild(sumCell_7)
                    tbody.appendChild(row);
                }
                for(let n = 1; n < peopleMsg_2_jcpt; n++) {
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m++]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            }
            if(flag == 6) { //总的标记从5开始
                for(; m < peopleMsg_2_kdh; m++) {  //第二个人开始
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            } else if(flag == 3 || flag == 4 || flag == 5) {
                if(peopleMsg_2_khd > 0) {
                    var row = document.createElement('tr');
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    var sumCell_4 = document.createElement('td');
                    var sumCell_5 = document.createElement('td');
                    var sumCell_6 = document.createElement('td');
                    var sumCell_7 = document.createElement('td');
                    sumCell_1.innerHTML = '<button type="button" class="layui-btn layui-btn-lg btn-checked">客户端（app）设计师</button>'; //岗位
                    sumCell_1.setAttribute('rowspan', peopleNum[6]);
                    sumCell_2.innerHTML = isEmpty(peopleMoney[6]);   //岗位单价
                    sumCell_2.setAttribute('rowspan', peopleNum[6]);
                    sumCell_3.innerHTML = peopleNum[6];   //岗位人数
                    sumCell_3.setAttribute('rowspan', peopleNum[6]);
                    sumCell_4.innerHTML = name[m];   //第一个人名
                    sumCell_5.innerHTML = planDay[m];   //第一个人日
                    sumCell_6.innerHTML = totalDay[m++];   //第一个税日
                    sumCell_7.innerHTML = totalMoney[p++]; //小计
                    sumCell_7.setAttribute('rowspan', peopleNum[6]);
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3)
                    row.appendChild(sumCell_4)
                    row.appendChild(sumCell_5)
                    row.appendChild(sumCell_6)
                    row.appendChild(sumCell_7)
                    tbody.appendChild(row);
                }
                for(let n = 1; n < peopleMsg_2_khd; n++) {
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m++]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            }
            if(flag == 7) { //总的标记从5开始
                for(; m < peopleMsg_2_qd; m++) {  //第二个人开始
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            } else if(flag == 3 || flag == 4 || flag == 5 || flag == 6) {
                if(peopleMsg_2_qd > 0) {
                    var row = document.createElement('tr');
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    var sumCell_4 = document.createElement('td');
                    var sumCell_5 = document.createElement('td');
                    var sumCell_6 = document.createElement('td');
                    var sumCell_7 = document.createElement('td');
                    sumCell_1.innerHTML = '<button type="button" class="layui-btn layui-btn-lg btn-checked">前端设计设计师</button>'; //岗位
                    sumCell_1.setAttribute('rowspan', peopleNum[7]);
                    sumCell_2.innerHTML = isEmpty(peopleMoney[7]);   //岗位单价
                    sumCell_2.setAttribute('rowspan', peopleNum[7]);
                    sumCell_3.innerHTML = peopleNum[7];   //岗位人数
                    sumCell_3.setAttribute('rowspan', peopleNum[7]);
                    sumCell_4.innerHTML = name[m];   //第一个人名
                    sumCell_5.innerHTML = planDay[m];   //第一个人日
                    sumCell_6.innerHTML = totalDay[m++];   //第一个税日
                    sumCell_7.innerHTML = totalMoney[p++]; //小计
                    sumCell_7.setAttribute('rowspan', peopleNum[7]);
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3)
                    row.appendChild(sumCell_4)
                    row.appendChild(sumCell_5)
                    row.appendChild(sumCell_6)
                    row.appendChild(sumCell_7)
                    tbody.appendChild(row);
                }
                for(let n = 1; n < peopleMsg_2_qd; n++) {
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m++]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            }
            if(flag == 8) { //总的标记从5开始
                for(; m < peopleMsg_2_ui; m++) {  //第二个人开始
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            } else if(flag == 3 || flag == 4 || flag == 5 || flag == 6 || flag == 7) {
                if(peopleMsg_2_ui > 0) {
                    var row = document.createElement('tr');
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    var sumCell_4 = document.createElement('td');
                    var sumCell_5 = document.createElement('td');
                    var sumCell_6 = document.createElement('td');
                    var sumCell_7 = document.createElement('td');
                    sumCell_1.innerHTML = '<button type="button" class="layui-btn layui-btn-lg btn-checked">UI设计师</button>'; //岗位
                    sumCell_1.setAttribute('rowspan', peopleNum[8]);
                    sumCell_2.innerHTML = isEmpty(peopleMoney[8]);   //岗位单价
                    sumCell_2.setAttribute('rowspan', peopleNum[8]);
                    sumCell_3.innerHTML = peopleNum[8];   //岗位人数
                    sumCell_3.setAttribute('rowspan', peopleNum[8]);
                    sumCell_4.innerHTML = name[m];   //第一个人名
                    sumCell_5.innerHTML = planDay[m];   //第一个人日
                    sumCell_6.innerHTML = totalDay[m++];   //第一个税日
                    sumCell_7.innerHTML = totalMoney[p++]; //小计
                    sumCell_7.setAttribute('rowspan', peopleNum[8]);
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3)
                    row.appendChild(sumCell_4)
                    row.appendChild(sumCell_5)
                    row.appendChild(sumCell_6)
                    row.appendChild(sumCell_7)
                    tbody.appendChild(row);
                }
                for(let n = 1; n < peopleMsg_2_ui; n++) {
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m++]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            }
        }; break;

        case 3 : {
            if(peopleMsg_3_java > 0) {
                flag = 9;
                money.push(peopleMoney[9]);     //记录每个岗位单价
                num.push(peopleNum[9]);     //记录每个岗位人数
                for(; i < peopleMsg_3_java; i++) {
                    planDay.push(isEmpty(allMsg[s_index].planDay)); //记录每个人的人日
                    totalDay.push(isEmpty(allMsg[s_index].totalDay)); //记录每个人的税日
                    jobTotalDay[9] += returnValue(isEmpty(allMsg[s_index].totalDay));
                    name.push(isEmpty(allMsg[s_index++].name));//记录每个人的姓名
                    countNumPerJob += returnValue(totalDay[i]);
                }
                totalMoney.push(countNumPerJob*returnValue(peopleMoney[9]));   //小计
                k++;
            }
            if(peopleMsg_3_az > 0) {
                if(flag == 0) flag = 10;
                money.push(peopleMoney[10]);
                num.push(peopleNum[10]);
                countNumPerJob = 0;
                for(var f = 0; f < peopleMsg_3_az; f++) {
                    planDay.push(isEmpty(allMsg[s_index].planDay)); //记录每个人的人日
                    totalDay.push(isEmpty(allMsg[s_index].totalDay)); //记录每个人的税日
                    jobTotalDay[10] += returnValue(isEmpty(allMsg[s_index].totalDay));
                    name.push(isEmpty(allMsg[s_index++].name));//记录每个人的姓名
                    countNumPerJob += returnValue(totalDay[i++]);
                }
                totalMoney.push(countNumPerJob*returnValue(peopleMoney[10])); //小计
                k++;
            }
            if(peopleMsg_3_pg > 0) {
                if(flag == 0) flag = 11;
                money.push(peopleMoney[11]);
                num.push(peopleNum[11]);
                countNumPerJob = 0;
                for(var f = 0; f < peopleMsg_3_pg; f++) {
                    planDay.push(isEmpty(allMsg[s_index].planDay)); //记录每个人的人日
                    totalDay.push(isEmpty(allMsg[s_index].totalDay)); //记录每个人的税日
                    jobTotalDay[11] += returnValue(isEmpty(allMsg[s_index].totalDay));
                    name.push(isEmpty(allMsg[s_index++].name));//记录每个人的姓名
                    countNumPerJob += returnValue(totalDay[i++]);
                }
                totalMoney.push(countNumPerJob*returnValue(peopleMoney[11])); //小计
                k++;
            }
            if(peopleMsg_3_c > 0) {
                if(flag == 0) flag = 12;
                money.push(peopleMoney[12]);
                num.push(peopleNum[12]);
                countNumPerJob = 0;
                for(var f = 0; f < peopleMsg_3_c; f++) {
                    planDay.push(isEmpty(allMsg[s_index].planDay)); //记录每个人的人日
                    totalDay.push(isEmpty(allMsg[s_index].totalDay)); //记录每个人的税日
                    jobTotalDay[12] += returnValue(isEmpty(allMsg[s_index].totalDay));
                    name.push(isEmpty(allMsg[s_index++].name));//记录每个人的姓名
                    countNumPerJob += returnValue(totalDay[i++]);
                }
                totalMoney.push(countNumPerJob*returnValue(peopleMoney[12])); //小计
                k++;
            }
            if(peopleMsg_3_qd > 0) {
                if(flag == 0) flag = 13;
                money.push(peopleMoney[13]);
                num.push(peopleNum[13]);
                countNumPerJob = 0;
                for(var f = 0; f < peopleMsg_3_qd; f++) {
                    planDay.push(isEmpty(allMsg[s_index].planDay)); //记录每个人的人日
                    totalDay.push(isEmpty(allMsg[s_index].totalDay)); //记录每个人的税日
                    jobTotalDay[13] += returnValue(isEmpty(allMsg[s_index].totalDay));
                    name.push(isEmpty(allMsg[s_index++].name));//记录每个人的姓名
                    countNumPerJob += returnValue(totalDay[i++]);
                }
                totalMoney.push(countNumPerJob*returnValue(peopleMoney[13])); //小计
                k++;
            }
            for(let j = 0; j < k; j++)  {
                countMoney += totalMoney[j];    //合计
            }
            /* 设置总的内容 */
            sumCell_1.innerHTML = '系统开发'; //工作内容
            sumCell_1.style.cssText="font-size: 16px"
            sumCell_1.setAttribute('rowspan', peopleMsg[3]);
            sumCell_2.innerHTML = peoplePlanDay[3]; //计划日
            sumCell_2.setAttribute('rowspan', peopleMsg[3]);
            sumCell_3.innerHTML = peopleTotalDay[3]; //含税日
            sumCell_3.setAttribute('rowspan', peopleMsg[3]);
            sumCell_4.innerHTML = '<button type="button" class="layui-btn layui-btn-lg btn-checked">' + jobText[flag] + '</button>'; //岗位
            sumCell_4.setAttribute('rowspan', peopleNum[flag]);
            sumCell_5.innerHTML = isEmpty(peopleMoney[flag]);   //岗位单价
            sumCell_5.setAttribute('rowspan', peopleNum[flag]);
            sumCell_6.innerHTML = peopleNum[flag];   //岗位人数
            sumCell_6.setAttribute('rowspan', peopleNum[flag]);
            sumCell_7.innerHTML = name[0];   //第一个人名
            sumCell_8.innerHTML = planDay[0];   //第一个人日
            sumCell_9.innerHTML = totalDay[0];   //第一个税日
            sumCell_10.innerHTML = returnBlank(totalMoney[0]); //小计
            sumCell_10.setAttribute('rowspan', peopleNum[flag]);
            sumCell_11.innerHTML = returnBlank(countMoney);   //合计
            sumCell_11.setAttribute('rowspan', peopleMsg[3]);
            rowSum.appendChild(sumCell_1);
            rowSum.appendChild(sumCell_2)
            rowSum.appendChild(sumCell_3)
            rowSum.appendChild(sumCell_4)
            rowSum.appendChild(sumCell_5)
            rowSum.appendChild(sumCell_6)
            rowSum.appendChild(sumCell_7)
            rowSum.appendChild(sumCell_8)
            rowSum.appendChild(sumCell_9)
            rowSum.appendChild(sumCell_10)
            rowSum.appendChild(sumCell_11);
            tbody.appendChild(rowSum);
            let m = 1;
            let p = 1;
            for(; m < peopleMsg_3_java; m++) {  //第二个人开始
                var row = document.createElement('tr'); //创建行 
                var sumCell_1 = document.createElement('td');
                var sumCell_2 = document.createElement('td');
                var sumCell_3 = document.createElement('td');
                sumCell_1.innerHTML = name[m]; //个人姓名
                sumCell_2.innerHTML = planDay[m]; //个人计划日
                sumCell_3.innerHTML = totalDay[m]; //个人含税日
                row.appendChild(sumCell_1)
                row.appendChild(sumCell_2)
                row.appendChild(sumCell_3);
                tbody.appendChild(row);
            }
            if(flag == 10) { //总的标记从4开始
                for(; m < peopleMsg_3_az; m++) {  //第二个人开始
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            } else if(flag == 9) {    //产品经理有数据
                if(peopleMsg_3_az > 0) {
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    var sumCell_4 = document.createElement('td');
                    var sumCell_5 = document.createElement('td');
                    var sumCell_6 = document.createElement('td');
                    var sumCell_7 = document.createElement('td');
                    sumCell_1.innerHTML = '<button type="button" class="layui-btn layui-btn-lg btn-checked">安卓开发工程师</button>'; //岗位
                    sumCell_1.setAttribute('rowspan', peopleNum[10]);
                    sumCell_2.innerHTML = isEmpty(peopleMoney[10]);   //岗位单价
                    sumCell_2.setAttribute('rowspan', peopleNum[10]);
                    sumCell_3.innerHTML = peopleNum[10];   //岗位人数
                    sumCell_3.setAttribute('rowspan', peopleNum[10]);
                    sumCell_4.innerHTML = name[m];   //第一个人名
                    sumCell_5.innerHTML = planDay[m];   //第一个人日
                    sumCell_6.innerHTML = totalDay[m++];   //第一个税日
                    sumCell_7.innerHTML = totalMoney[p++]; //小计
                    sumCell_7.setAttribute('rowspan', peopleNum[10]);
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3)
                    row.appendChild(sumCell_4)
                    row.appendChild(sumCell_5)
                    row.appendChild(sumCell_6)
                    row.appendChild(sumCell_7)
                    tbody.appendChild(row);
                }
                for(let n = 1; n < peopleMsg_3_az; n++) {
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m++]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            }
            if(flag == 11) { //总的标记从5开始
                for(; m < peopleMsg_3_pg; m++) {  //第二个人开始
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            } else if(flag == 9 || flag == 10) {
                if(peopleMsg_3_pg > 0) {
                    var row = document.createElement('tr');
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    var sumCell_4 = document.createElement('td');
                    var sumCell_5 = document.createElement('td');
                    var sumCell_6 = document.createElement('td');
                    var sumCell_7 = document.createElement('td');
                    sumCell_1.innerHTML = '<button type="button" class="layui-btn layui-btn-lg btn-checked">苹果开发工程师</button>'; //岗位
                    sumCell_1.setAttribute('rowspan', peopleNum[11]);
                    sumCell_2.innerHTML = isEmpty(peopleMoney[11]);   //岗位单价
                    sumCell_2.setAttribute('rowspan', peopleNum[11]);
                    sumCell_3.innerHTML = peopleNum[11];   //岗位人数
                    sumCell_3.setAttribute('rowspan', peopleNum[11]);
                    sumCell_4.innerHTML = name[m];   //第一个人名
                    sumCell_5.innerHTML = planDay[m];   //第一个人日
                    sumCell_6.innerHTML = totalDay[m++];   //第一个税日
                    sumCell_7.innerHTML = totalMoney[p++]; //小计
                    sumCell_7.setAttribute('rowspan', peopleNum[11]);
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3)
                    row.appendChild(sumCell_4)
                    row.appendChild(sumCell_5)
                    row.appendChild(sumCell_6)
                    row.appendChild(sumCell_7)
                    tbody.appendChild(row);
                }
                for(let n = 1; n < peopleMsg_3_pg; n++) {
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m++]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            }
            if(flag == 12) { //总的标记从5开始
                for(; m < peopleMsg_3_c; m++) {  //第二个人开始
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            } else if(flag == 9 || flag == 10 || flag == 11) {
                if(peopleMsg_3_c > 0) {
                    var row = document.createElement('tr');
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    var sumCell_4 = document.createElement('td');
                    var sumCell_5 = document.createElement('td');
                    var sumCell_6 = document.createElement('td');
                    var sumCell_7 = document.createElement('td');
                    sumCell_1.innerHTML = '<button type="button" class="layui-btn layui-btn-lg btn-checked">C#开发工程师</button>'; //岗位
                    sumCell_1.setAttribute('rowspan', peopleNum[12]);
                    sumCell_2.innerHTML = isEmpty(peopleMoney[12]);   //岗位单价
                    sumCell_2.setAttribute('rowspan', peopleNum[12]);
                    sumCell_3.innerHTML = peopleNum[12];   //岗位人数
                    sumCell_3.setAttribute('rowspan', peopleNum[12]);
                    sumCell_4.innerHTML = name[m];   //第一个人名
                    sumCell_5.innerHTML = planDay[m];   //第一个人日
                    sumCell_6.innerHTML = totalDay[m++];   //第一个税日
                    sumCell_7.innerHTML = totalMoney[p++]; //小计
                    sumCell_7.setAttribute('rowspan', peopleNum[12]);
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3)
                    row.appendChild(sumCell_4)
                    row.appendChild(sumCell_5)
                    row.appendChild(sumCell_6)
                    row.appendChild(sumCell_7)
                    tbody.appendChild(row);
                }
                for(let n = 1; n < peopleMsg_3_c; n++) {
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m++]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            }
            if(flag == 13) { //总的标记从5开始
                for(; m < peopleMsg_3_qd; m++) {  //第二个人开始
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            } else if(flag == 9 || flag == 10 || flag == 11 || flag == 12) {
                if(peopleMsg_3_qd > 0) {
                    var row = document.createElement('tr');
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    var sumCell_4 = document.createElement('td');
                    var sumCell_5 = document.createElement('td');
                    var sumCell_6 = document.createElement('td');
                    var sumCell_7 = document.createElement('td');
                    sumCell_1.innerHTML = '<button type="button" class="layui-btn layui-btn-lg btn-checked">前端开发工程师</button>'; //岗位
                    sumCell_1.setAttribute('rowspan', peopleNum[13]);
                    sumCell_2.innerHTML = isEmpty(peopleMoney[13]);   //岗位单价
                    sumCell_2.setAttribute('rowspan', peopleNum[13]);
                    sumCell_3.innerHTML = peopleNum[13];   //岗位人数
                    sumCell_3.setAttribute('rowspan', peopleNum[13]);
                    sumCell_4.innerHTML = name[m];   //第一个人名
                    sumCell_5.innerHTML = planDay[m];   //第一个人日
                    sumCell_6.innerHTML = totalDay[m++];   //第一个税日
                    sumCell_7.innerHTML = totalMoney[p++]; //小计
                    sumCell_7.setAttribute('rowspan', peopleNum[13]);
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3)
                    row.appendChild(sumCell_4)
                    row.appendChild(sumCell_5)
                    row.appendChild(sumCell_6)
                    row.appendChild(sumCell_7)
                    tbody.appendChild(row);
                }
                for(let n = 1; n < peopleMsg_3_qd; n++) {
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m++]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            }
        }; break;

        case 4 : {
            for(; i < peopleMsg[4]; i++) {
                planDay.push(isEmpty(allMsg[s_index].planDay)); //记录每个人的人日
                totalDay.push(isEmpty(allMsg[s_index].totalDay)); //记录每个人的税日
                jobTotalDay[14] += returnValue(isEmpty(allMsg[s_index].totalDay));
                name.push(isEmpty(allMsg[s_index++].name));//记录每个人的姓名
                countNumPerJob += returnValue(totalDay[i]);
            }
            totalMoney.push(countNumPerJob*returnValue(peopleMoney[13]));   //小计
            k++;
            countMoney += totalMoney[0];    //合计
            /* 设置总的内容 */
            sumCell_1.innerHTML = '系统测试'; //工作内容
            sumCell_1.style.cssText="font-size: 16px"
            sumCell_1.setAttribute('rowspan', peopleMsg[4]);
            sumCell_2.innerHTML = peoplePlanDay[4]; //计划日
            sumCell_2.setAttribute('rowspan', peopleMsg[4]);
            sumCell_3.innerHTML = peopleTotalDay[4]; //含税日
            sumCell_3.setAttribute('rowspan', peopleMsg[4]);
            sumCell_4.innerHTML = '<button type="button" class="layui-btn layui-btn-lg btn-checked">测试工程师</button>'; //岗位
            sumCell_4.setAttribute('rowspan', peopleNum[14]);
            sumCell_5.innerHTML = isEmpty(peopleMoney[14]);   //岗位单价
            sumCell_5.setAttribute('rowspan', peopleNum[14]);
            sumCell_6.innerHTML = peopleNum[14];   //岗位人数
            sumCell_6.setAttribute('rowspan', peopleNum[14]);
            sumCell_7.innerHTML = name[0];   //第一个人名
            sumCell_8.innerHTML = planDay[0];   //第一个人日
            sumCell_9.innerHTML = totalDay[0];   //第一个税日
            sumCell_10.innerHTML = returnBlank(totalMoney[0]); //小计
            sumCell_10.setAttribute('rowspan', peopleNum[14]);
            sumCell_11.innerHTML = returnBlank(countMoney);   //合计
            sumCell_11.setAttribute('rowspan', peopleMsg[4]);
            rowSum.appendChild(sumCell_1);
            rowSum.appendChild(sumCell_2)
            rowSum.appendChild(sumCell_3)
            rowSum.appendChild(sumCell_4)
            rowSum.appendChild(sumCell_5)
            rowSum.appendChild(sumCell_6)
            rowSum.appendChild(sumCell_7)
            rowSum.appendChild(sumCell_8)
            rowSum.appendChild(sumCell_9)
            rowSum.appendChild(sumCell_10)
            rowSum.appendChild(sumCell_11);
            tbody.appendChild(rowSum);
            for(let m = 1; m < peopleMsg[4]; m++) {  //第二个人开始
                var row = document.createElement('tr'); //创建行 
                var sumCell_1 = document.createElement('td');
                var sumCell_2 = document.createElement('td');
                var sumCell_3 = document.createElement('td');
                sumCell_1.innerHTML = name[m]; //个人姓名
                sumCell_2.innerHTML = planDay[m]; //个人计划日
                sumCell_3.innerHTML = totalDay[m]; //个人含税日
                row.appendChild(sumCell_1)
                row.appendChild(sumCell_2)
                row.appendChild(sumCell_3);
                tbody.appendChild(row);
            }
        }; break;
        case 5 : {
            for(; i < peopleMsg[5]; i++) {
                planDay.push(isEmpty(allMsg[s_index].planDay)); //记录每个人的人日
                totalDay.push(isEmpty(allMsg[s_index].totalDay)); //记录每个人的税日
                jobTotalDay[15] += returnValue(isEmpty(allMsg[s_index].totalDay));
                name.push(isEmpty(allMsg[s_index++].name));//记录每个人的姓名
                countNumPerJob += returnValue(totalDay[i]);
            }
            totalMoney.push(countNumPerJob*returnValue(peopleMoney[14]));   //小计
            k++;
            countMoney += totalMoney[0];    //合计
            /* 设置总的内容 */
            sumCell_1.innerHTML = '业务支撑'; //工作内容
            sumCell_1.style.cssText="font-size: 16px"
            sumCell_1.setAttribute('rowspan', peopleMsg[5]);
            sumCell_2.innerHTML = peoplePlanDay[5]; //计划日
            sumCell_2.setAttribute('rowspan', peopleMsg[5]);
            sumCell_3.innerHTML = peopleTotalDay[5]; //含税日
            sumCell_3.setAttribute('rowspan', peopleMsg[5]);
            sumCell_4.innerHTML = '<button type="button" class="layui-btn layui-btn-lg btn-checked">业务经理</button>'; //岗位
            sumCell_4.setAttribute('rowspan', peopleNum[15]);
            sumCell_5.innerHTML = isEmpty(peopleMoney[15]);   //岗位单价
            sumCell_5.setAttribute('rowspan', peopleNum[15]);
            sumCell_6.innerHTML = peopleNum[15];   //岗位人数
            sumCell_6.setAttribute('rowspan', peopleNum[15]);
            sumCell_7.innerHTML = name[0];   //第一个人名
            sumCell_8.innerHTML = planDay[0];   //第一个人日
            sumCell_9.innerHTML = totalDay[0];   //第一个税日
            sumCell_10.innerHTML = returnBlank(totalMoney[0]); //小计
            sumCell_10.setAttribute('rowspan', peopleNum[15]);
            sumCell_11.innerHTML = returnBlank(countMoney);   //合计
            sumCell_11.setAttribute('rowspan', peopleMsg[5]);
            rowSum.appendChild(sumCell_1);
            rowSum.appendChild(sumCell_2)
            rowSum.appendChild(sumCell_3)
            rowSum.appendChild(sumCell_4)
            rowSum.appendChild(sumCell_5)
            rowSum.appendChild(sumCell_6)
            rowSum.appendChild(sumCell_7)
            rowSum.appendChild(sumCell_8)
            rowSum.appendChild(sumCell_9)
            rowSum.appendChild(sumCell_10)
            rowSum.appendChild(sumCell_11);
            tbody.appendChild(rowSum);
            for(let m = 1; m < peopleMsg[5]; m++) {  //第二个人开始
                var row = document.createElement('tr'); //创建行 
                var sumCell_1 = document.createElement('td');
                var sumCell_2 = document.createElement('td');
                var sumCell_3 = document.createElement('td');
                sumCell_1.innerHTML = name[m]; //个人姓名
                sumCell_2.innerHTML = planDay[m]; //个人计划日
                sumCell_3.innerHTML = totalDay[m]; //个人含税日
                row.appendChild(sumCell_1)
                row.appendChild(sumCell_2)
                row.appendChild(sumCell_3);
                tbody.appendChild(row);
            }
        }; break;
        case 6 : {
            for(; i < peopleMsg[6]; i++) {
                planDay.push(isEmpty(allMsg[s_index].planDay)); //记录每个人的人日
                totalDay.push(isEmpty(allMsg[s_index].totalDay)); //记录每个人的税日
                jobTotalDay[16] += returnValue(isEmpty(allMsg[s_index].totalDay));
                name.push(isEmpty(allMsg[s_index++].name));//记录每个人的姓名
                countNumPerJob += returnValue(totalDay[i]);
            }
            totalMoney.push(countNumPerJob*returnValue(peopleMoney[15]));   //小计
            k++;
            countMoney += totalMoney[0];    //合计
            /* 设置总的内容 */
            sumCell_1.innerHTML = '系统实施'; //工作内容
            sumCell_1.style.cssText="font-size: 16px"
            sumCell_1.setAttribute('rowspan', peopleMsg[6]);
            sumCell_2.innerHTML = peoplePlanDay[6]; //计划日
            sumCell_2.setAttribute('rowspan', peopleMsg[6]);
            sumCell_3.innerHTML = peopleTotalDay[6]; //含税日
            sumCell_3.setAttribute('rowspan', peopleMsg[6]);
            sumCell_4.innerHTML = '<button type="button" class="layui-btn layui-btn-lg btn-checked">实施工程师</button>'; //岗位
            sumCell_4.setAttribute('rowspan', peopleNum[16]);
            sumCell_5.innerHTML = isEmpty(peopleMoney[16]);   //岗位单价
            sumCell_5.setAttribute('rowspan', peopleNum[16]);
            sumCell_6.innerHTML = peopleNum[16];   //岗位人数
            sumCell_6.setAttribute('rowspan', peopleNum[16]);
            sumCell_7.innerHTML = name[0];   //第一个人名
            sumCell_8.innerHTML = planDay[0];   //第一个人日
            sumCell_9.innerHTML = totalDay[0];   //第一个税日
            sumCell_10.innerHTML = returnBlank(totalMoney[0]); //小计
            sumCell_10.setAttribute('rowspan', peopleNum[16]);
            sumCell_11.innerHTML = returnBlank(countMoney);   //合计
            sumCell_11.setAttribute('rowspan', peopleMsg[6]);
            rowSum.appendChild(sumCell_1);
            rowSum.appendChild(sumCell_2)
            rowSum.appendChild(sumCell_3)
            rowSum.appendChild(sumCell_4)
            rowSum.appendChild(sumCell_5)
            rowSum.appendChild(sumCell_6)
            rowSum.appendChild(sumCell_7)
            rowSum.appendChild(sumCell_8)
            rowSum.appendChild(sumCell_9)
            rowSum.appendChild(sumCell_10)
            rowSum.appendChild(sumCell_11);
            tbody.appendChild(rowSum);
            for(let m = 1; m < peopleMsg[6]; m++) {  //第二个人开始
                var row = document.createElement('tr'); //创建行 
                var sumCell_1 = document.createElement('td');
                var sumCell_2 = document.createElement('td');
                var sumCell_3 = document.createElement('td');
                sumCell_1.innerHTML = name[m]; //个人姓名
                sumCell_2.innerHTML = planDay[m]; //个人计划日
                sumCell_3.innerHTML = totalDay[m]; //个人含税日
                row.appendChild(sumCell_1)
                row.appendChild(sumCell_2)
                row.appendChild(sumCell_3);
                tbody.appendChild(row);
            }
        }; break;
        case 7 : {
            for(; i < peopleMsg[7]; i++) {
                planDay.push(isEmpty(allMsg[s_index].planDay)); //记录每个人的人日
                totalDay.push(isEmpty(allMsg[s_index].totalDay)); //记录每个人的税日
                jobTotalDay[17] += returnValue(isEmpty(allMsg[s_index].totalDay));
                name.push(isEmpty(allMsg[s_index++].name));//记录每个人的姓名
                countNumPerJob += returnValue(totalDay[i]);
            }
            totalMoney.push(countNumPerJob*returnValue(peopleMoney[16]));   //小计
            k++;
            countMoney += totalMoney[0];    //合计
            /* 设置总的内容 */
            sumCell_1.innerHTML = '项目管理'; //工作内容
            sumCell_1.style.cssText="font-size: 16px"
            sumCell_1.setAttribute('rowspan', peopleMsg[7]);
            sumCell_2.innerHTML = peoplePlanDay[7]; //计划日
            sumCell_2.setAttribute('rowspan', peopleMsg[7]);
            sumCell_3.innerHTML = peopleTotalDay[7]; //含税日
            sumCell_3.setAttribute('rowspan', peopleMsg[7]);
            sumCell_4.innerHTML = '<button type="button" class="layui-btn layui-btn-lg btn-checked">项目总监</button>'; //岗位
            sumCell_4.setAttribute('rowspan', peopleNum[17]);
            sumCell_5.innerHTML = isEmpty(peopleMoney[16]);   //岗位单价
            sumCell_5.setAttribute('rowspan', peopleNum[17]);
            sumCell_6.innerHTML = peopleNum[17];   //岗位人数
            sumCell_6.setAttribute('rowspan', peopleNum[17]);
            sumCell_7.innerHTML = name[0];   //第一个人名
            sumCell_8.innerHTML = planDay[0];   //第一个人日
            sumCell_9.innerHTML = totalDay[0];   //第一个税日
            sumCell_10.innerHTML = returnBlank(totalMoney[0]); //小计
            sumCell_10.setAttribute('rowspan', peopleNum[17]);
            sumCell_11.innerHTML = returnBlank(countMoney);   //合计
            sumCell_11.setAttribute('rowspan', peopleMsg[7]);
            rowSum.appendChild(sumCell_1);
            rowSum.appendChild(sumCell_2)
            rowSum.appendChild(sumCell_3)
            rowSum.appendChild(sumCell_4)
            rowSum.appendChild(sumCell_5)
            rowSum.appendChild(sumCell_6)
            rowSum.appendChild(sumCell_7)
            rowSum.appendChild(sumCell_8)
            rowSum.appendChild(sumCell_9)
            rowSum.appendChild(sumCell_10)
            rowSum.appendChild(sumCell_11);
            tbody.appendChild(rowSum);
            for(let m = 1; m < peopleMsg[7]; m++) {  //第二个人开始
                var row = document.createElement('tr'); //创建行 
                var sumCell_1 = document.createElement('td');
                var sumCell_2 = document.createElement('td');
                var sumCell_3 = document.createElement('td');
                sumCell_1.innerHTML = name[m]; //个人姓名
                sumCell_2.innerHTML = planDay[m]; //个人计划日
                sumCell_3.innerHTML = totalDay[m]; //个人含税日
                row.appendChild(sumCell_1)
                row.appendChild(sumCell_2)
                row.appendChild(sumCell_3);
                tbody.appendChild(row);
            }
        }; break;
        case 8 : {
            for(; i < peopleMsg[8]; i++) {
                planDay.push(isEmpty(allMsg[s_index].planDay)); //记录每个人的人日
                totalDay.push(isEmpty(allMsg[s_index].totalDay)); //记录每个人的税日
                jobTotalDay[18] += returnValue(isEmpty(allMsg[s_index].totalDay));
                name.push(isEmpty(allMsg[s_index++].name));//记录每个人的姓名
                countNumPerJob += returnValue(totalDay[i]);
            }
            totalMoney.push(countNumPerJob*returnValue(peopleMoney[17]));   //小计
            k++;
            countMoney += totalMoney[0];    //合计
            /* 设置总的内容 */
            sumCell_1.innerHTML = '技术管理'; //工作内容
            sumCell_1.style.cssText="font-size: 16px"
            sumCell_1.setAttribute('rowspan', peopleMsg[8]);
            sumCell_2.innerHTML = peoplePlanDay[8]; //计划日
            sumCell_2.setAttribute('rowspan', peopleMsg[8]);
            sumCell_3.innerHTML = peopleTotalDay[8]; //含税日
            sumCell_3.setAttribute('rowspan', peopleMsg[8]);
            sumCell_4.innerHTML = '<button type="button" class="layui-btn layui-btn-lg btn-checked">技术总监</button>'; //岗位
            sumCell_4.setAttribute('rowspan', peopleNum[18]);
            sumCell_5.innerHTML = isEmpty(peopleMoney[18]);   //岗位单价
            sumCell_5.setAttribute('rowspan', peopleNum[18]);
            sumCell_6.innerHTML = peopleNum[18];   //岗位人数
            sumCell_6.setAttribute('rowspan', peopleNum[18]);
            sumCell_7.innerHTML = name[0];   //第一个人名
            sumCell_8.innerHTML = planDay[0];   //第一个人日
            sumCell_9.innerHTML = totalDay[0];   //第一个税日
            sumCell_10.innerHTML = returnBlank(totalMoney[0]); //小计
            sumCell_10.setAttribute('rowspan', peopleNum[18]);
            sumCell_11.innerHTML = returnBlank(countMoney);   //合计
            sumCell_11.setAttribute('rowspan', peopleMsg[8]);
            rowSum.appendChild(sumCell_1);
            rowSum.appendChild(sumCell_2)
            rowSum.appendChild(sumCell_3)
            rowSum.appendChild(sumCell_4)
            rowSum.appendChild(sumCell_5)
            rowSum.appendChild(sumCell_6)
            rowSum.appendChild(sumCell_7)
            rowSum.appendChild(sumCell_8)
            rowSum.appendChild(sumCell_9)
            rowSum.appendChild(sumCell_10)
            rowSum.appendChild(sumCell_11);
            tbody.appendChild(rowSum);
            for(let m = 1; m < peopleMsg[8]; m++) {  //第二个人开始
                var row = document.createElement('tr'); //创建行 
                var sumCell_1 = document.createElement('td');
                var sumCell_2 = document.createElement('td');
                var sumCell_3 = document.createElement('td');
                sumCell_1.innerHTML = name[m]; //个人姓名
                sumCell_2.innerHTML = planDay[m]; //个人计划日
                sumCell_3.innerHTML = totalDay[m]; //个人含税日
                row.appendChild(sumCell_1)
                row.appendChild(sumCell_2)
                row.appendChild(sumCell_3);
                tbody.appendChild(row);
            }
        }; break;
    }
}
var systemIndexNum = -1;
function getDataRow2(typeId, jobArr, fun){
    systemIndexNum++;
    var flag = getFlagNum(jobArr, fun);// 1(平台) 2 3 41 42 43 44 45
    switch(flag){
        case 0 : {
            if(typeId == 41 || typeId == 42 || typeId == 43 || typeId == 44 || typeId == 45) {
                var t = document.getElementById('sys'+typeId);
                t.style.display="none";
            } else {
                setNullFun(typeId);
            }
        }; break;
        case 1 : {
            setJobArr(typeId, jobArr);
            setNullFun(typeId);
        }; break;
        case 2 : {
            setFun(typeId, fun)
        }; break;
        case 3 : {
            setJobArr(typeId, jobArr);
            setFun(typeId, fun);
        }; break;
    }
/*
    var table4_2 = document.getElementById('sys2');   //接口层
    var table4_3 = document.getElementById('sys3');   //后台管理
    var table4_1_1 = document.getElementById('sys41');   //小程序
    var table4_1_2 = document.getElementById('sys42');   //H5端
    var table4_1_3 = document.getElementById('sys43');   //客户端app
    var table4_1_4 = document.getElementById('sys44');   //pc端
    var table4_1_5 = document.getElementById('sys45');   //公众号

    var table4_1_1_fun = document.getElementById('sys41_fun');   //小程序
    var table4_1_2_fun = document.getElementById('sys42_fun');   //H5端
    var table4_1_3_fun = document.getElementById('sys43_fun');   //客户端app
    var table4_1_4_fun = document.getElementById('sys44_fun');   //pc端
    var table4_1_5_fun = document.getElementById('sys45_fun');   //公众号
    var table4_2_fun = document.getElementById('sys2_fun');   //接口层
    var table4_3_fun = document.getElementById('sys3_fun');   //后台管理


    var table4_1_1_msg = document.getElementById('sys41_msg');   //小程序
    var table4_1_2_msg = document.getElementById('sys42_msg');   //H5端
    var table4_1_3_msg = document.getElementById('sys43_msg');   //客户端app
    var table4_1_4_msg = document.getElementById('sys44_msg');   //pc端
    var table4_1_5_msg = document.getElementById('sys45_msg');   //公众号
    var table4_2_msg = document.getElementById('sys2_msg');   //接口层
    var table4_3_msg = document.getElementById('sys3_msg');   //后台管理*!/*/
}

function getFlagNum(job, fun){
    var num = fun.funNum;
    var flag = (num == null || num == 0) ? 0 : 1;
    switch(job.length) {
        case 0: {
            switch(flag) {
                case 0: return 0;
                default: return 2;
            }; break;
        }; break;
        default: {
            switch(flag) {
                case 0: return 1;
                default: return 3;
            }; break;
        }; break;
    }
}

function setJobArr(index, jobArr){
    var money = 0;
    var day = 0;
    for(let i = 0, j = 1; i < 13; i++, j++) {
        if(jobArr[i] != null && jobArr[i].num != null) {
            $('#sys'+index+' #num_'+j).text(jobArr[i].num);
            $('#sys'+index+' #money_'+j).text(isEmpty(jobArr[i].money));
            $('#sys'+index+' #t_'+j).text(isEmpty(jobArr[i].planDay));
            $('#sys'+index+' #p_'+j).text(isEmpty(jobArr[i].totalDay));
            var total = returnValue(isEmpty(jobArr[i].totalDay) * returnValue(isEmpty(jobArr[i].money)));
            $('#sys'+index+' #total_'+j).text(returnBlank(total));
            money += total;
            day += isEmpty(jobArr[i].planDay);
        }
    }
    $('#sys'+index+' #total').text(returnBlank(money));
    systemTotalNum[systemIndexNum] = returnBlank(money) != "" ? money : null;
    $('#sys'+index+' #totalDay2').text(returnBlank(day));
}

function setFun(index, fun){
    if(fun.funNum != null && fun.funNum != 0) {
        var funNameArr = fun.funName.split('_');
        var funNum = fun.funNum;
        var funMsgArr = fun.funMsg.split('/');
        var nameT;
        switch(index){
            case 1 : nameT  = "基础平台"; break;
            case 2 : nameT  = "接口层"; break;
            case 3 : nameT  = "服务层"; break;
            case 41 : nameT = "应用层——小程序端"; break;
            case 42 : nameT = "应用层——H5端"; break;
            case 43 : nameT = "应用层——客户端(App)"; break;
            case 44 : nameT = "应用层——PC端"; break;
            case 45 : nameT = "应用层——公众号端"; break;
        }

        var t = document.getElementById('sys'+index);

        var row_1 = document.createElement('tr');
        var cell_1 = document.createElement('td');
        cell_1.innerHTML = projectName;
        cell_1.style.cssText="font-size: 16px"
        cell_1.setAttribute('rowspan', funNum);
        cell_1.setAttribute('colspan', 2);
        var cell_2 = document.createElement('td');
        cell_2.innerHTML = nameT;
        cell_2.style.cssText="font-size: 16px"
        cell_2.setAttribute('rowspan', funNum);
        var cell_3 = document.createElement('td');
        cell_3.innerHTML = funNameArr[0];
        var cell_4 = document.createElement('td');
        cell_4.innerHTML = funMsgArr[0];
        cell_4.setAttribute('colspan', 5);
        row_1.appendChild(cell_1)
        row_1.appendChild(cell_2)
        row_1.appendChild(cell_3)
        row_1.appendChild(cell_4);
        t.appendChild(row_1);

        for(let i = 1; i < funNum; i++) {
            var row = document.createElement('tr');
            var ocell_1 = document.createElement('td');
            ocell_1.innerHTML = funNameArr[i];
            var ocell_2 = document.createElement('td');
            ocell_2.innerHTML = funMsgArr[i];
            ocell_2.setAttribute('colspan', 5);
            row.appendChild(ocell_1)
            row.appendChild(ocell_2);
            t.appendChild(row);
        }
    }
}

function setNullFun(index){
    var t = document.getElementById('sys'+index);
    var row = document.createElement('tr');
    var cell = document.createElement('td');
    cell.style.cssText="font-size: 16px"
    cell.innerHTML = "无数据";
    cell.setAttribute('colspan', 10);
    row.appendChild(cell);
    t.appendChild(row);
}

function csv2sheet(csv) {
    var sheet = {}; // 将要生成的sheet
    csv = csv.split('\n');
    csv.forEach(function(row, i) {
        row = row.split(',');
        if(i == 0) sheet['!ref'] = 'A1:'+String.fromCharCode(65+row.length-1)+(csv.length-1);
        row.forEach(function(col, j) {
            sheet[String.fromCharCode(65+j)+(i+1)] = {v: col};
        });
    });
    return sheet;
}

function sheet2blob(sheet, sheetName) {
    sheetName = sheetName || 'sheet1';
    var workbook = {
        SheetNames: [sheetName],
        Sheets: {}
    };
    workbook.Sheets[sheetName] = sheet;
    // 生成excel的配置项
    var wopts = {
        bookType: 'xlsx', // 要生成的文件类型
        bookSST: false, // 是否生成Shared String Table，官方解释是，如果开启生成速度会下降，但在低版本IOS设备上有更好的兼容性
        type: 'binary'
    };
    var wbout = XLSX.write(workbook, wopts);
    var blob = new Blob([s2ab(wbout)], {type:"application/octet-stream"});
    // 字符串转ArrayBuffer
    function s2ab(s) {
        var buf = new ArrayBuffer(s.length);
        var view = new Uint8Array(buf);
        for (var i=0; i!=s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;
        return buf;
    }
    return blob;
}

/**
 * 通用的打开下载对话框方法，没有测试过具体兼容性
 * @param url 下载地址，也可以是一个blob对象，必选
 * @param saveName 保存文件名，可选
 */
function openDownloadDialog(url, saveName) {
    if(typeof url == 'object' && url instanceof Blob)   {
        url = URL.createObjectURL(url); // 创建blob地址
    }
    var aLink = document.createElement('a');
    aLink.href = url;
    aLink.download = saveName; // HTML5新增的属性，指定保存文件名，可以不要后缀，注意，file:///模式下不会生效
    var event;
    if(window.MouseEvent) event = new MouseEvent('click');
    else {
        event = document.createEvent('MouseEvents');
        event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
    }
    aLink.dispatchEvent(event);
}
function openDownloadDialogArr(urlArr, saveNameArr) {
    for(var i = 0; i < urlArr.length; i++) {
        if(typeof urlArr[i] == 'object' && urlArr[i] instanceof Blob)   {
            urlArr[i] = URL.createObjectURL(urlArr[i]); // 创建blob地址
        }
        var aLink = document.createElement('a');
        aLink.href = urlArr[i];
        aLink.download = saveNameArr[i]; // HTML5新增的属性，指定保存文件名，可以不要后缀，注意，file:///模式下不会生效
        var event;
        if(window.MouseEvent) event = new MouseEvent('click');
        else {
            event = document.createEvent('MouseEvents');
            event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
        }
        aLink.dispatchEvent(event);
    }
}

function exportExcel() {
    var customerMsg = "姓名: "+data.System1.headName+"   电话号码: "+data.System1.headPhone+"   邮箱: "+data.System1.headEmail;
    var deliveryTimePlace = "时间: "+data.System1.deliveryTime+"   地点: "+data.System1.deliveryPlace;

    var table1 = [
        [null, null, null, null, null, null, null, null, null, null],
        [null, '项目名称', null, null, null, data.System1.projectName,  null, null, null, null],
        [null, '客户名称', null, null, null, data.System1.customerName, null, null, null, null],
        [null, '客户项目负责人信息', null, null, null, customerMsg,     null, null, null, null],
        [null, '交付时间、地点', null, null, null, deliveryTimePlace,   null, null, null, null],
        [null, '交付内容', null, null, null, data.System1.deliverables, null, null, null, null],
        [null, null, null, null, null, null, null, null, null, null],
        [null, '交付方式', null, null, null, data.System1.deliveryWay, null, null, null, null],
        [null, '项目开发人员安排计划', null, null, null, null, null, null, null, null],
        [null, '工作内容', null, '项目实施计划(日)', null, '投入岗位', null, '人员名称',  null, '计划人日']
    ]
    var sheet2 = XLSX.utils.aoa_to_sheet(table1);

    var table4 = [
        [null, null,         null,               null, null, null,    null,    null,      null],
        [null, projectName,  null,               null, null, null,    null,    null,      null],
        [null,  "价 格 表",  null,               null, null, null,    null,    null,      null],
        [null, "序号",      "产品名称",          null, null, "单位", "数量", "单价(元)", "价格(元)"],
        [null, "（1）",      projectName+"开发", null, null, "套",    null,   null,       null],
        [null, "（2）",      "业务支撑",         null, null, "项",    null,   null,       null],
        [null, "（3）",      "系统实施",         null, null, "项",    null,   null,       null],
        [null, "（4）",      "项目管理",         null, null, "项",    null,   null,       null],
        [null, "（5）",      "技术管理",         null, null, "项",    null,   null,       null],
        [null, "含税总价",   "(小写)",           null, null, null,    null,   null,       null],
        [null, null,         "(大写)",           null, null, null,    null,   null,       null],
        [null, null,         null,               null, null, null,    null,   null,       null],
        [null, projectName+"开发-价格明细表",    null, null, null,    null,   null,       null,   null],
        [null, "工作流程",   null, "实际计划安排(日)", "投入岗位", "投入人数", "人日", "单价(元)", "费用(元)", null],
    ];
    var sheet5 = XLSX.utils.aoa_to_sheet(table4);
    var sheet5Flag = 13;
    sheet5['!merges']= [
        {s: {r: 1, c: 1},  e: {r: 1, c: 8}},
        {s: {r: 2, c: 1},  e: {r: 2, c: 8}},
        {s: {r: 7, c: 2},  e: {r: 7, c: 4}},
        {s: {r: 3, c: 2},  e: {r: 3, c: 4}},
        {s: {r: 4, c: 2},  e: {r: 4, c: 4}},
        {s: {r: 5, c: 2},  e: {r: 5, c: 4}},
        {s: {r: 6, c: 2},  e: {r: 6, c: 4}},
        {s: {r: 8, c: 2},  e: {r: 8, c: 4}},
        {s: {r: 9, c: 1},  e: {r: 10, c: 1}},
        {s: {r: 9, c: 3},  e: {r: 9, c: 8}},
        {s: {r: 10, c: 3},  e: {r: 10, c: 8}},
        {s: {r: 11, c: 1},  e: {r: 11, c: 8}},
        {s: {r: 12, c: 1},  e: {r: 12, c: 8}},
        {s: {r: 13, c: 1},  e: {r: 13, c: 2}},
    ];

    var s5Flag = 0;

    if(jobTotalDay[1] > 0) {
        s5Flag++;
        XLSX.utils.sheet_add_json(sheet5, [{
            工作流程: "需求调研",
            项目实施计划:  peoplePlanDay[1],
            投入岗位: "产品经理",
            投入人数: peopleNum[1],
            人日: jobTotalDay[1],
            单价: peopleMoney[1]
        }], {header: ["", "工作流程", "", '项目实施计划', "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
        if(jobTotalDay[2] > 0) {
            s5Flag++;
            XLSX.utils.sheet_add_json(sheet5, [{
                投入岗位: "需求分析师",
                投入人数: peopleNum[2],
                人日: jobTotalDay[2],
                单价: peopleMoney[2]
            }], {header: ["", "工作流程", "", '项目实施计划', "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
        }
    } else {
        if(jobTotalDay[2] > 0) {
            s5Flag++;
            XLSX.utils.sheet_add_json(sheet5, [{
                工作流程: "需求调研",
                项目实施计划:  peoplePlanDay[1],
                投入岗位: "需求分析师",
                投入人数: peopleNum[2],
                人日: jobTotalDay[2],
                单价: peopleMoney[2]
            }], {header: ["", "工作流程", "", '项目实施计划',  "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
        }
    }
    if(s5Flag > 0) {
        sheet5['!merges'].push({s: {r: sheet5Flag+1, c: 1},  e: {r: sheet5Flag+s5Flag, c: 2}});
        sheet5['!merges'].push({s: {r: sheet5Flag+1, c: 3},  e: {r: sheet5Flag+s5Flag, c: 3}});
    }
    sheet5Flag+=s5Flag;

    s5Flag = 0;
    if(jobTotalDay[3] > 0) {
        s5Flag++;
        XLSX.utils.sheet_add_json(sheet5, [{
            工作流程: "系统设计",
            项目实施计划:  peoplePlanDay[2],
            投入岗位: "产品经理",
            投入人数: peopleNum[3],
            人日: jobTotalDay[3],
            单价: peopleMoney[3]
        }], {header: ["", "工作流程", "", '项目实施计划', "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
        if(jobTotalDay[4] > 0) {
            s5Flag++;
            XLSX.utils.sheet_add_json(sheet5, [{
                投入岗位: "应用架构师设计师",
                投入人数: peopleNum[4],
                人日: jobTotalDay[4],
                单价: peopleMoney[4]
            }], {header: ["", "工作流程", "", '项目实施计划', "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
        }
        if(jobTotalDay[5] > 0) {
            s5Flag++;
            XLSX.utils.sheet_add_json(sheet5, [{
                投入岗位: "基础平台设计师",
                投入人数: peopleNum[5],
                人日: jobTotalDay[5],
                单价: peopleMoney[5]
            }], {header: ["", "工作流程", "", '项目实施计划', "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
        }
        if(jobTotalDay[6] > 0) {
            s5Flag++;
            XLSX.utils.sheet_add_json(sheet5, [{
                投入岗位: "客户端（app）设计师",
                投入人数: peopleNum[6],
                人日: jobTotalDay[6],
                单价: peopleMoney[6]
            }], {header: ["", "工作流程", "", '项目实施计划', "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
        }
        if(jobTotalDay[7] > 0) {
            s5Flag++;
            XLSX.utils.sheet_add_json(sheet5, [{
                投入岗位: "前端设计设计师",
                投入人数: peopleNum[7],
                人日: jobTotalDay[7],
                单价: peopleMoney[7]
            }], {header: ["", "工作流程", "", '项目实施计划', "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
        }
        if(jobTotalDay[8] > 0) {
            s5Flag++;
            XLSX.utils.sheet_add_json(sheet5, [{
                投入岗位: "UI设计师",
                投入人数: peopleNum[8],
                人日: jobTotalDay[8],
                单价: peopleMoney[8]
            }], {header: ["", "工作流程", "", '项目实施计划', "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
        }
    } else if(jobTotalDay[4] > 0) {
        s5Flag++;
        XLSX.utils.sheet_add_json(sheet5, [{
            工作流程: "系统设计",
            项目实施计划:  peoplePlanDay[2],
            投入岗位: "应用架构师设计师",
            投入人数: peopleNum[4],
            人日: jobTotalDay[4],
            单价: peopleMoney[4]
        }], {header: ["", "工作流程", "", '项目实施计划',  "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
        if(jobTotalDay[5] > 0) {
            s5Flag++;
            XLSX.utils.sheet_add_json(sheet5, [{
                投入岗位: "基础平台设计师",
                投入人数: peopleNum[5],
                人日: jobTotalDay[5],
                单价: peopleMoney[5]
            }], {header: ["", "工作流程", "", '项目实施计划', "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
        }
        if(jobTotalDay[6] > 0) {
            s5Flag++;
            XLSX.utils.sheet_add_json(sheet5, [{
                投入岗位: "客户端（app）设计师",
                投入人数: peopleNum[6],
                人日: jobTotalDay[6],
                单价: peopleMoney[6]
            }], {header: ["", "工作流程", "", '项目实施计划', "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
        }
        if(jobTotalDay[7] > 0) {
            s5Flag++;
            XLSX.utils.sheet_add_json(sheet5, [{
                投入岗位: "前端设计设计师",
                投入人数: peopleNum[7],
                人日: jobTotalDay[7],
                单价: peopleMoney[7]
            }], {header: ["", "工作流程", "", '项目实施计划', "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
        }
        if(jobTotalDay[8] > 0) {
            s5Flag++;
            XLSX.utils.sheet_add_json(sheet5, [{
                投入岗位: "UI设计师",
                投入人数: peopleNum[8],
                人日: jobTotalDay[8],
                单价: peopleMoney[8]
            }], {header: ["", "工作流程", "", '项目实施计划', "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
        }
    } else if(jobTotalDay[5] > 0) {
        s5Flag++;
        XLSX.utils.sheet_add_json(sheet5, [{
            工作流程: "系统设计",
            项目实施计划:  peoplePlanDay[2],
            投入岗位: "基础平台设计师",
            投入人数: peopleNum[5],
            人日: jobTotalDay[5],
            单价: peopleMoney[5]
        }], {header: ["", "工作流程", "", '项目实施计划',  "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
        if(jobTotalDay[6] > 0) {
            s5Flag++;
            XLSX.utils.sheet_add_json(sheet5, [{
                投入岗位: "客户端（app）设计师",
                投入人数: peopleNum[6],
                人日: jobTotalDay[6],
                单价: peopleMoney[6]
            }], {header: ["", "工作流程", "", '项目实施计划', "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
        }
        if(jobTotalDay[7] > 0) {
            s5Flag++;
            XLSX.utils.sheet_add_json(sheet5, [{
                投入岗位: "前端设计设计师",
                投入人数: peopleNum[7],
                人日: jobTotalDay[7],
                单价: peopleMoney[7]
            }], {header: ["", "工作流程", "", '项目实施计划', "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
        }
        if(jobTotalDay[8] > 0) {
            s5Flag++;
            XLSX.utils.sheet_add_json(sheet5, [{
                投入岗位: "UI设计师",
                投入人数: peopleNum[8],
                人日: jobTotalDay[8],
                单价: peopleMoney[8]
            }], {header: ["", "工作流程", "", '项目实施计划', "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
        }
    } else if(jobTotalDay[6] > 0) {
        s5Flag++;
        XLSX.utils.sheet_add_json(sheet5, [{
            工作流程: "系统设计",
            项目实施计划:  peoplePlanDay[2],
            投入岗位: "客户端（app）设计师",
            投入人数: peopleNum[6],
            人日: jobTotalDay[6],
            单价: peopleMoney[6]
        }], {header: ["", "工作流程", "", '项目实施计划',  "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
        if(jobTotalDay[7] > 0) {
            s5Flag++;
            XLSX.utils.sheet_add_json(sheet5, [{
                投入岗位: "前端设计设计师",
                投入人数: peopleNum[7],
                人日: jobTotalDay[7],
                单价: peopleMoney[7]
            }], {header: ["", "工作流程", "", '项目实施计划', "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
        }
        if(jobTotalDay[8] > 0) {
            s5Flag++;
            XLSX.utils.sheet_add_json(sheet5, [{
                投入岗位: "UI设计师",
                投入人数: peopleNum[8],
                人日: jobTotalDay[8],
                单价: peopleMoney[8]
            }], {header: ["", "工作流程", "", '项目实施计划', "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
        }
    } else if(jobTotalDay[7] > 0) {
        s5Flag++;
        XLSX.utils.sheet_add_json(sheet5, [{
            工作流程: "系统设计",
            项目实施计划:  peoplePlanDay[2],
            投入岗位: "前端设计设计师",
            投入人数: peopleNum[7],
            人日: jobTotalDay[7],
            单价: peopleMoney[7]
        }], {header: ["", "工作流程", "", '项目实施计划',  "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
        if(jobTotalDay[8] > 0) {
            s5Flag++;
            XLSX.utils.sheet_add_json(sheet5, [{
                投入岗位: "UI设计师",
                投入人数: peopleNum[8],
                人日: jobTotalDay[8],
                单价: peopleMoney[8]
            }], {header: ["", "工作流程", "", '项目实施计划', "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
        }
    } else if(jobTotalDay[8] > 0) {
        s5Flag++;
        XLSX.utils.sheet_add_json(sheet5, [{
            工作流程: "系统设计",
            项目实施计划:  peoplePlanDay[2],
            投入岗位: "UI设计师",
            投入人数: peopleNum[8],
            人日: jobTotalDay[8],
            单价: peopleMoney[8]
        }], {header: ["", "工作流程", "", '项目实施计划',  "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
    }
    if(s5Flag > 0) {
        sheet5['!merges'].push({s: {r: sheet5Flag+1, c: 1},  e: {r: sheet5Flag+s5Flag, c: 2}});
        sheet5['!merges'].push({s: {r: sheet5Flag+1, c: 3},  e: {r: sheet5Flag+s5Flag, c: 3}});
    }
    sheet5Flag+=s5Flag;

    s5Flag = 0;
    if(jobTotalDay[9] > 0) {
        s5Flag++;
        XLSX.utils.sheet_add_json(sheet5, [{
            工作流程: "系统开发",
            项目实施计划:  peoplePlanDay[3],
            投入岗位: "java开发工程师",
            投入人数: peopleNum[9],
            人日: jobTotalDay[9],
            单价: peopleMoney[9]
        }], {header: ["", "工作流程", "", '项目实施计划', "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
        if(jobTotalDay[10] > 0) {
            s5Flag++;
            XLSX.utils.sheet_add_json(sheet5, [{
                投入岗位: "安卓开发工程师",
                投入人数: peopleNum[10],
                人日: jobTotalDay[10],
                单价: peopleMoney[10]
            }], {header: ["", "工作流程", "", '项目实施计划', "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
        }
        if(jobTotalDay[11] > 0) {
            s5Flag++;
            XLSX.utils.sheet_add_json(sheet5, [{
                投入岗位: "苹果开发工程师",
                投入人数: peopleNum[11],
                人日: jobTotalDay[11],
                单价: peopleMoney[11]
            }], {header: ["", "工作流程", "", '项目实施计划', "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
        }
        if(jobTotalDay[12] > 0) {
            s5Flag++;
            XLSX.utils.sheet_add_json(sheet5, [{
                投入岗位: "C#开发工程师",
                投入人数: peopleNum[12],
                人日: jobTotalDay[12],
                单价: peopleMoney[12]
            }], {header: ["", "工作流程", "", '项目实施计划', "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
        }
        if(jobTotalDay[13] > 0) {
            s5Flag++;
            XLSX.utils.sheet_add_json(sheet5, [{
                投入岗位: "前端开发工程师",
                投入人数: peopleNum[13],
                人日: jobTotalDay[13],
                单价: peopleMoney[13]
            }], {header: ["", "工作流程", "", '项目实施计划', "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
        }
    } else if(jobTotalDay[10] > 0) {
        s5Flag++;
        XLSX.utils.sheet_add_json(sheet5, [{
            工作流程: "系统开发",
            项目实施计划:  peoplePlanDay[10],
            投入岗位: "安卓开发工程师",
            投入人数: peopleNum[10],
            人日: jobTotalDay[10],
            单价: peopleMoney[10]
        }], {header: ["", "工作流程", "", '项目实施计划',  "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
        if(jobTotalDay[11] > 0) {
            s5Flag++;
            XLSX.utils.sheet_add_json(sheet5, [{
                投入岗位: "苹果开发工程师",
                投入人数: peopleNum[11],
                人日: jobTotalDay[11],
                单价: peopleMoney[11]
            }], {header: ["", "工作流程", "", '项目实施计划', "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
        }
        if(jobTotalDay[12] > 0) {
            s5Flag++;
            XLSX.utils.sheet_add_json(sheet5, [{
                投入岗位: "C#开发工程师",
                投入人数: peopleNum[12],
                人日: jobTotalDay[12],
                单价: peopleMoney[12]
            }], {header: ["", "工作流程", "", '项目实施计划', "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
        }
        if(jobTotalDay[13] > 0) {
            s5Flag++;
            XLSX.utils.sheet_add_json(sheet5, [{
                投入岗位: "前端开发工程师",
                投入人数: peopleNum[13],
                人日: jobTotalDay[13],
                单价: peopleMoney[13]
            }], {header: ["", "工作流程", "", '项目实施计划', "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
        }
    } else if(jobTotalDay[11] > 0) {
        s5Flag++;
        XLSX.utils.sheet_add_json(sheet5, [{
            工作流程: "系统开发",
            项目实施计划:  peoplePlanDay[3],
            投入岗位: "苹果开发工程师",
            投入人数: peopleNum[11],
            人日: jobTotalDay[11],
            单价: peopleMoney[11]
        }], {header: ["", "工作流程", "", '项目实施计划',  "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
        if(jobTotalDay[12] > 0) {
            s5Flag++;
            XLSX.utils.sheet_add_json(sheet5, [{
                投入岗位: "C#开发工程师",
                投入人数: peopleNum[12],
                人日: jobTotalDay[12],
                单价: peopleMoney[12]
            }], {header: ["", "工作流程", "", '项目实施计划', "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
        }
        if(jobTotalDay[13] > 0) {
            s5Flag++;
            XLSX.utils.sheet_add_json(sheet5, [{
                投入岗位: "前端开发工程师",
                投入人数: peopleNum[13],
                人日: jobTotalDay[13],
                单价: peopleMoney[13]
            }], {header: ["", "工作流程", "", '项目实施计划', "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
        }
    } else if(jobTotalDay[12] > 0) {
        s5Flag++;
        XLSX.utils.sheet_add_json(sheet5, [{
            工作流程: "系统开发",
            项目实施计划:  peoplePlanDay[3],
            投入岗位: "C#开发工程师",
            投入人数: peopleNum[12],
            人日: jobTotalDay[12],
            单价: peopleMoney[12]
        }], {header: ["", "工作流程", "", '项目实施计划',  "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
        if(jobTotalDay[13] > 0) {
            s5Flag++;
            XLSX.utils.sheet_add_json(sheet5, [{
                投入岗位: "前端开发工程师",
                投入人数: peopleNum[13],
                人日: jobTotalDay[13],
                单价: peopleMoney[13]
            }], {header: ["", "工作流程", "", '项目实施计划', "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
        }
    } else if(jobTotalDay[13] > 0) {
        s5Flag++;
        XLSX.utils.sheet_add_json(sheet5, [{
            工作流程: "系统开发",
            项目实施计划:  peoplePlanDay[3],
            投入岗位: "前端开发工程师",
            投入人数: peopleNum[13],
            人日: jobTotalDay[13],
            单价: peopleMoney[13]
        }], {header: ["", "工作流程", "", '项目实施计划',  "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
    }
    if(s5Flag > 0) {
        sheet5['!merges'].push({s: {r: sheet5Flag+1, c: 1},  e: {r: sheet5Flag+s5Flag, c: 2}});
        sheet5['!merges'].push({s: {r: sheet5Flag+1, c: 3},  e: {r: sheet5Flag+s5Flag, c: 3}});
    }
    sheet5Flag+=s5Flag;

    s5Flag=0;
    if(jobTotalDay[14] > 0) {
        s5Flag++;
        XLSX.utils.sheet_add_json(sheet5, [{
            工作流程: "系统测试",
            项目实施计划:  peoplePlanDay[4],
            投入岗位: "测试工程师",
            投入人数: peopleNum[14],
            人日: jobTotalDay[14],
            单价: peopleMoney[14]
        }], {header: ["", "工作流程", "", '项目实施计划', "投入岗位", "投入人数", "人日", "单价"], skipHeader: true, origin: -1});
    }
    if(s5Flag > 0) {
        sheet5['!merges'].push({s: {r: sheet5Flag+1, c: 1},  e: {r: sheet5Flag+s5Flag, c: 2}});
        sheet5['!merges'].push({s: {r: sheet5Flag+1, c: 3},  e: {r: sheet5Flag+s5Flag, c: 3}});
    }
    sheet5Flag+=s5Flag;

    var s5t = "";
    for(var j = 15; j <= sheet5Flag+1; j++){
        var g = "G"+j;
        var h = "H"+j;
        var I = "I"+j;
        sheet5[I] = { t:'n', f: g+'*'+h, F:I };
        s5t += I+"+";
    }
    s5t=s5t.substr(0, s5t.length-1);
    sheet5['H5'] = { t:'n', f: s5t, F:'H5' };
    sheet5['I'+(sheet5Flag+2)] = { t:'n', f: s5t, F:'I'+(sheet5Flag+2) };
    sheet5Flag+=1;
    XLSX.utils.sheet_add_aoa(sheet5, [
        [null, "总计(含税):", null, null, null, null,null, null, null],
        [null, "系统交付物清单", null, null, null, null,null, null, null],
        [null, "软件开发", null, null, null, null,null, null, null],
        [null, "一级系统", "二级系统", "项目端", "核心功能描述", null,null, null, null],
    ], {origin: -1});
    sheet5['!merges'].push({s: {r: sheet5Flag, c: 1},  e: {r: sheet5Flag, c: 7}});
    sheet5['!merges'].push({s: {r: sheet5Flag+1, c: 1},  e: {r: sheet5Flag+1, c: 8}});
    sheet5['!merges'].push({s: {r: sheet5Flag+2, c: 1},  e: {r: sheet5Flag+2, c: 8}});
    sheet5['!merges'].push({s: {r: sheet5Flag+3, c: 4},  e: {r: sheet5Flag+3, c: 8}});
    sheet5Flag+=3;

    var index = 0;
    var xqfxCpjl = 0;
    var xqfxXqfxs = 0;
    var xqfx = 1;
    if(peopleNum[1] > 0) {
        var totalDayNum = returnValue(isEmpty(allMsg[index].totalDay));
        XLSX.utils.sheet_add_json(sheet2, [{
            工作内容: "需求调研",
            项目实施计划:  peoplePlanDay[1],
            投入岗位: "产品经理",
            人员名称: allMsg[index].name,
            计划人日: allMsg[index++].planDay
        }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});

        for(var i = 1; i < peopleNum[1]; i++) {
            totalDayNum += returnValue(isEmpty(allMsg[index].totalDay))
            XLSX.utils.sheet_add_json(sheet2, [{
                人员名称: allMsg[index].name,
                计划人日: allMsg[index++].planDay
            }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
            xqfxCpjl++;
            xqfx++;
        }

    } else {
        XLSX.utils.sheet_add_json(sheet2, [{
            工作内容: "需求调研",
            项目实施计划:  peoplePlanDay[1],
            投入岗位: "产品经理",
            人员名称: "",
            计划人日: ""
        }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
    }

    if(peopleNum[2] > 0) {
        XLSX.utils.sheet_add_json(sheet2, [{
            投入岗位: "需求分析师",
            人员名称: allMsg[index].name,
            计划人日: allMsg[index++].planDay
        }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
        for(var i = 1; i < peopleNum[2]; i++) {
            XLSX.utils.sheet_add_json(sheet2, [{
                人员名称: allMsg[index].name,
                计划人日: allMsg[index++].planDay
            }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
            xqfxXqfxs++;
            xqfx++;
        }
    } else {
        XLSX.utils.sheet_add_json(sheet2, [{
            投入岗位: "需求分析师",
            人员名称: "",
            计划人日: ""
        }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
    }

    var xtsj1 = 0;
    var xtsj2 = 0;
    var xtsj3 = 0;
    var xtsj4 = 0;
    var xtsj5 = 0;
    var xtsj6 = 0;
    var xtsj = 6;
    if(peopleNum[3] > 0) {
        XLSX.utils.sheet_add_json(sheet2, [{
            工作内容: "系统设计",
            项目实施计划:  peoplePlanDay[2],
            投入岗位: "产品经理",
            人员名称: allMsg[index].name,
            计划人日: allMsg[index++].planDay
        }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
        for(var i = 1; i < peopleNum[3]; i++) {
            XLSX.utils.sheet_add_json(sheet2, [{
                人员名称: allMsg[index].name,
                计划人日: allMsg[index++].planDay
            }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
            xtsj++;
            xtsj1++;
        }
    } else {
        XLSX.utils.sheet_add_json(sheet2, [{
            工作内容: "系统设计",
            项目实施计划:  peoplePlanDay[2],
            投入岗位: "产品经理",
            人员名称: "",
            计划人日: ""
        }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
    }

    if(peopleNum[4] > 0) {
        XLSX.utils.sheet_add_json(sheet2, [{
            投入岗位: "应用架构设计师",
            人员名称: allMsg[index].name,
            计划人日: allMsg[index++].planDay
        }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
        for(var i = 1; i < peopleNum[4]; i++) {
            XLSX.utils.sheet_add_json(sheet2, [{
                人员名称: allMsg[index].name,
                计划人日: allMsg[index++].planDay
            }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
            xtsj++;
            xtsj2++;
        }
    } else {
        XLSX.utils.sheet_add_json(sheet2, [{
            投入岗位: "应用架构设计师",
            人员名称: "",
            计划人日: ""
        }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
    }

    if(peopleNum[5] > 0) {
        XLSX.utils.sheet_add_json(sheet2, [{
            投入岗位: "基础平台设计师",
            人员名称: allMsg[index].name,
            计划人日: allMsg[index++].planDay
        }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
        for(var i = 1; i < peopleNum[5]; i++) {
            XLSX.utils.sheet_add_json(sheet2, [{
                人员名称: allMsg[index].name,
                计划人日: allMsg[index++].planDay
            }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
            xtsj++;
            xtsj3++;
        }
    } else {
        XLSX.utils.sheet_add_json(sheet2, [{
            投入岗位: "基础平台设计师",
            人员名称: "",
            计划人日: ""
        }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
    }

    if(peopleNum[6] > 0) {
        XLSX.utils.sheet_add_json(sheet2, [{
            投入岗位: "客户端（app）设计师",
            人员名称: allMsg[index].name,
            计划人日: allMsg[index++].planDay
        }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
        for(var i = 1; i < peopleNum[6]; i++) {
            XLSX.utils.sheet_add_json(sheet2, [{
                人员名称: allMsg[index].name,
                计划人日: allMsg[index++].planDay
            }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
            xtsj++;
            xtsj4++;
        }
    } else {
        XLSX.utils.sheet_add_json(sheet2, [{
            投入岗位: "客户端（app）设计师",
            人员名称: "",
            计划人日: ""
        }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
    }

    if(peopleNum[7] > 0) {
        XLSX.utils.sheet_add_json(sheet2, [{
            投入岗位: "前端设计设计师",
            人员名称: allMsg[index].name,
            计划人日: allMsg[index++].planDay
        }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
        for(var i = 1; i < peopleNum[7]; i++) {
            XLSX.utils.sheet_add_json(sheet2, [{
                人员名称: allMsg[index].name,
                计划人日: allMsg[index++].planDay
            }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
            xtsj++;
            xtsj5++;
        }
    } else {
        XLSX.utils.sheet_add_json(sheet2, [{
            投入岗位: "前端设计设计师",
            人员名称: "",
            计划人日: ""
        }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
    }

    if(peopleNum[8] > 0) {
        XLSX.utils.sheet_add_json(sheet2, [{
            投入岗位: "UI设计师",
            人员名称: allMsg[index].name,
            计划人日: allMsg[index++].planDay
        }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
        for(var i = 1; i < peopleNum[8]; i++) {
            XLSX.utils.sheet_add_json(sheet2, [{
                人员名称: allMsg[index].name,
                计划人日: allMsg[index++].planDay
            }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
            xtsj++;
            xtsj6++;
        }
    } else {
        XLSX.utils.sheet_add_json(sheet2, [{
            投入岗位: "UI设计师",
            人员名称: "",
            计划人日: ""
        }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
    }

    var xtkf1 = 0;
    var xtkf2 = 0;
    var xtkf3 = 0;
    var xtkf4 = 0;
    var xtkf5 = 0;
    var xtkf = 5;
    if(peopleNum[9] > 0) {
        XLSX.utils.sheet_add_json(sheet2, [{
            工作内容: "系统开发",
            项目实施计划:  peoplePlanDay[3],
            投入岗位: "java开发工程师",
            人员名称: allMsg[index].name,
            计划人日: allMsg[index++].planDay
        }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
        for(var i = 1; i < peopleNum[9]; i++) {
            XLSX.utils.sheet_add_json(sheet2, [{
                人员名称: allMsg[index].name,
                计划人日: allMsg[index++].planDay
            }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
            xtkf1++;
            xtkf++;
        }
    } else {
        XLSX.utils.sheet_add_json(sheet2, [{
            工作内容: "系统开发",
            项目实施计划:  peoplePlanDay[3]+peoplePlanDay[4]+peoplePlanDay[5]+peoplePlanDay[6]+peoplePlanDay[7]+peoplePlanDay[8],
            投入岗位: "java开发工程师",
            人员名称: "",
            计划人日: ""
        }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
    }

    if(peopleNum[10] > 0) {
        XLSX.utils.sheet_add_json(sheet2, [{
            投入岗位: "安卓开发工程师",
            人员名称: allMsg[index].name,
            计划人日: allMsg[index++].planDay
        }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
        for(var i = 1; i < peopleNum[10]; i++) {
            XLSX.utils.sheet_add_json(sheet2, [{
                人员名称: allMsg[index].name,
                计划人日: allMsg[index++].planDay
            }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
            xtkf2++;
            xtkf++;
        }
    } else {
        XLSX.utils.sheet_add_json(sheet2, [{
            投入岗位: "安卓开发工程师",
            人员名称: "",
            计划人日: ""
        }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
    }

    if(peopleNum[11] > 0) {
        XLSX.utils.sheet_add_json(sheet2, [{
            投入岗位: "苹果开发工程师",
            人员名称: allMsg[index].name,
            计划人日: allMsg[index++].planDay
        }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
        for(var i = 1; i < peopleNum[11]; i++) {
            XLSX.utils.sheet_add_json(sheet2, [{
                人员名称: allMsg[index].name,
                计划人日: allMsg[index++].planDay
            }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
            xtkf3++;
            xtkf++;
        }
    } else {
        XLSX.utils.sheet_add_json(sheet2, [{
            投入岗位: "苹果开发工程师",
            人员名称: "",
            计划人日: ""
        }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
    }

    if(peopleNum[12] > 0) {
        XLSX.utils.sheet_add_json(sheet2, [{
            投入岗位: "C#开发工程师",
            人员名称: allMsg[index].name,
            计划人日: allMsg[index++].planDay
        }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
        for(var i = 1; i < peopleNum[12]; i++) {
            XLSX.utils.sheet_add_json(sheet2, [{
                人员名称: allMsg[index].name,
                计划人日: allMsg[index++].planDay
            }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
            xtkf4++;
            xtkf++;
        }
    } else {
        XLSX.utils.sheet_add_json(sheet2, [{
            投入岗位: "C#开发工程师",
            人员名称: "",
            计划人日: ""
        }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
    }

    if(peopleNum[13] > 0) {
        XLSX.utils.sheet_add_json(sheet2, [{
            投入岗位: "前端开发工程师",
            人员名称: allMsg[index].name,
            计划人日: allMsg[index++].planDay
        }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
        for(var i = 1; i < peopleNum[13]; i++) {
            XLSX.utils.sheet_add_json(sheet2, [{
                人员名称: allMsg[index].name,
                计划人日: allMsg[index++].planDay
            }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
            xtkf5++;
            xtkf++;
        }
    } else {
        XLSX.utils.sheet_add_json(sheet2, [{
            投入岗位: "前端开发工程师",
            人员名称: "",
            计划人日: ""
        }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
    }

    var xqcs = 1;
    if(peopleNum[14] > 0) {
        XLSX.utils.sheet_add_json(sheet2, [{
            工作内容: "系统测试",
            项目实施计划:  peoplePlanDay[4],
            投入岗位: "测试工程师",
            人员名称: allMsg[index].name,
            计划人日: allMsg[index++].planDay
        }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
        for(var i = 1; i < peopleNum[14]; i++) {
            XLSX.utils.sheet_add_json(sheet2, [{
                人员名称: allMsg[index].name,
                计划人日: allMsg[index++].planDay
            }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
            xqcs++;
        }
    } else {
        XLSX.utils.sheet_add_json(sheet2, [{
            工作内容: "系统测试",
            项目实施计划:  peoplePlanDay[4],
            投入岗位: "测试工程师",
            人员名称: "",
            计划人日: ""
        }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
    }

    var ywzc = 1;
    if(peopleNum[15] > 0) {
        XLSX.utils.sheet_add_json(sheet2, [{
            工作内容: "业务支撑",
            项目实施计划:  peoplePlanDay[5],
            投入岗位: "业务经理",
            人员名称: allMsg[index].name,
            计划人日: allMsg[index++].planDay
        }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
        for(var i = 1; i < peopleNum[15]; i++) {
            XLSX.utils.sheet_add_json(sheet2, [{
                人员名称: allMsg[index].name,
                计划人日: allMsg[index++].planDay
            }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
            ywzc++;
        }
    } else {
        XLSX.utils.sheet_add_json(sheet2, [{
            工作内容: "业务支撑",
            项目实施计划:  peoplePlanDay[5],
            投入岗位: "业务经理",
            人员名称: "",
            计划人日: ""
        }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
    }

    var xtss = 1;
    if(peopleNum[6] > 0) {
        XLSX.utils.sheet_add_json(sheet2, [{
            工作内容: "系统实施",
            项目实施计划:  peoplePlanDay[6],
            投入岗位: "实施工程师",
            人员名称: allMsg[index].name,
            计划人日: allMsg[index++].planDay
        }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
        for(var i = 1; i < peopleNum[16]; i++) {
            XLSX.utils.sheet_add_json(sheet2, [{
                人员名称: allMsg[index].name,
                计划人日: allMsg[index++].planDay
            }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
            xtss++;
        }
    } else {
        XLSX.utils.sheet_add_json(sheet2, [{
            工作内容: "系统实施",
            项目实施计划:  peoplePlanDay[6],
            投入岗位: "实施工程师",
            人员名称: "",
            计划人日: ""
        }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
    }


    var xmgl = 1;
    if(peopleNum[7] > 0) {
        XLSX.utils.sheet_add_json(sheet2, [{
            工作内容: "项目管理",
            项目实施计划:  peoplePlanDay[7],
            投入岗位: "项目总监",
            人员名称: allMsg[index].name,
            计划人日: allMsg[index++].planDay
        }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
        for(var i = 1; i < peopleNum[17]; i++) {
            XLSX.utils.sheet_add_json(sheet2, [{
                人员名称: allMsg[index].name,
                计划人日: allMsg[index++].planDay
            }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
            xmgl++;
        }
    } else {
        XLSX.utils.sheet_add_json(sheet2, [{
            工作内容: "项目管理",
            项目实施计划:  peoplePlanDay[7],
            投入岗位: "项目总监",
            人员名称: "",
            计划人日: ""
        }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
    }

    var jsgl = 1;
    if(peopleNum[8] > 0) {
        XLSX.utils.sheet_add_json(sheet2, [{
            工作内容: "技术管理",
            项目实施计划:  peoplePlanDay[8],
            投入岗位: "技术总监",
            人员名称: allMsg[index].name,
            计划人日: allMsg[index++].planDay
        }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
        for(var i = 1; i < peopleNum[8]; i++) {
            XLSX.utils.sheet_add_json(sheet2, [{
                人员名称: allMsg[index].name,
                计划人日: allMsg[index++].planDay
            }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
            jsgl++;
        }
    } else {
        XLSX.utils.sheet_add_json(sheet2, [{
            工作内容: "技术管理",
            项目实施计划:  peoplePlanDay[8],
            投入岗位: "技术总监",
            人员名称: "",
            计划人日: ""
        }], {header: ["", "工作内容", "", '项目实施计划', "", "投入岗位", "", "人员名称", "", '计划人日'], skipHeader: true, origin: -1});
    }

    var workPlanFlag_1 = 10+xqfx;
    var workPlanFlag_1_1 = 10+xqfxCpjl;
    var workPlanFlag_1_2 = workPlanFlag_1_1+1+xqfxXqfxs;
    var workPlanFlag_2 = workPlanFlag_1_2+xtsj;
    var workPlanFlag_2_1 = workPlanFlag_1_2+xtsj1+1;
    var workPlanFlag_2_2 = workPlanFlag_2_1+xtsj2+1;
    var workPlanFlag_2_3 = workPlanFlag_2_2+xtsj3+1;
    var workPlanFlag_2_4 = workPlanFlag_2_3+xtsj4+1;
    var workPlanFlag_2_5 = workPlanFlag_2_4+xtsj5+1;
    var workPlanFlag_2_6 = workPlanFlag_2_5+xtsj6+1;
    var workPlanFlag_3 = workPlanFlag_2_6+xtkf;
    var workPlanFlag_3_1 = workPlanFlag_2_6+xtkf1+1;
    var workPlanFlag_3_2 = workPlanFlag_3_1+xtkf2+1;
    var workPlanFlag_3_3 = workPlanFlag_3_2+xtkf3+1;
    var workPlanFlag_3_4 = workPlanFlag_3_3+xtkf4+1;
    var workPlanFlag_3_5 = workPlanFlag_3_4+xtkf5+1;
    var workPlanFlag_4 = workPlanFlag_3_5+xqcs;
    var workPlanFlag_5 = workPlanFlag_4+ywzc;
    var workPlanFlag_6 = workPlanFlag_5+xtss;
    var workPlanFlag_7 = workPlanFlag_6+xmgl;
    var workPlanFlag_8 = workPlanFlag_7+jsgl;

    sheet2['!merges'] = [
        // 设置A1-C1的单元格合并
        {s: {r: 1, c: 1}, e: {r: 1, c: 4}},
        {s: {r: 1, c: 5}, e: {r: 1, c: 9}},
        {s: {r: 2, c: 1}, e: {r: 2, c: 4}},
        {s: {r: 2, c: 5}, e: {r: 2, c: 9}},
        {s: {r: 3, c: 1}, e: {r: 3, c: 4}},
        {s: {r: 3, c: 5}, e: {r: 3, c: 9}},
        {s: {r: 4, c: 1}, e: {r: 4, c: 4}},
        {s: {r: 4, c: 5}, e: {r: 4, c: 9}},
        {s: {r: 5, c: 1}, e: {r: 6, c: 4}},
        {s: {r: 5, c: 5}, e: {r: 6, c: 9}},
        {s: {r: 7, c: 1}, e: {r: 7, c: 4}},
        {s: {r: 7, c: 5}, e: {r: 7, c: 9}},
        {s: {r: 8, c: 1}, e: {r: 8, c: 9}},
        {s: {r: 9, c: 1}, e: {r: 9, c: 2}},
        {s: {r: 9, c: 3}, e: {r: 9, c: 4}},
        {s: {r: 9, c: 5}, e: {r: 9, c: 6}},
        {s: {r: 9, c: 7}, e: {r: 9, c: 8}},

        {s: {r: 10, c: 1}, e: {r: workPlanFlag_1, c: 2}},
        {s: {r: 10, c: 3}, e: {r: workPlanFlag_1, c: 4}},
        {s: {r: 10, c: 5}, e: {r: workPlanFlag_1_1, c: 6}},
        {s: {r: workPlanFlag_1_1+1, c: 5}, e: {r: workPlanFlag_1_2, c: 6}},

        {s: {r: workPlanFlag_1_2+1, c: 1}, e: {r: workPlanFlag_2, c: 2}},
        {s: {r: workPlanFlag_1_2+1, c: 3}, e: {r: workPlanFlag_2, c: 4}},
        {s: {r: workPlanFlag_1_2+1, c: 5}, e: {r: workPlanFlag_2_1, c: 6}},
        {s: {r: workPlanFlag_2_1+1, c: 5}, e: {r: workPlanFlag_2_2, c: 6}},
        {s: {r: workPlanFlag_2_2+1, c: 5}, e: {r: workPlanFlag_2_3, c: 6}},
        {s: {r: workPlanFlag_2_3+1, c: 5}, e: {r: workPlanFlag_2_4, c: 6}},
        {s: {r: workPlanFlag_2_4+1, c: 5}, e: {r: workPlanFlag_2_5, c: 6}},
        {s: {r: workPlanFlag_2_5+1, c: 5}, e: {r: workPlanFlag_2_6, c: 6}},

        {s: {r: workPlanFlag_2_6+1, c: 1}, e: {r: workPlanFlag_3, c: 2}},
        {s: {r: workPlanFlag_2_6+1, c: 3}, e: {r: workPlanFlag_3, c: 4}},
        {s: {r: workPlanFlag_2_6+1, c: 5}, e: {r: workPlanFlag_3_1, c: 6}},
        {s: {r: workPlanFlag_3_1+1, c: 5}, e: {r: workPlanFlag_3_2, c: 6}},
        {s: {r: workPlanFlag_3_2+1, c: 5}, e: {r: workPlanFlag_3_3, c: 6}},
        {s: {r: workPlanFlag_3_3+1, c: 5}, e: {r: workPlanFlag_3_4, c: 6}},
        {s: {r: workPlanFlag_3_4+1, c: 5}, e: {r: workPlanFlag_3_5, c: 6}},

        {s: {r: workPlanFlag_3_5+1, c: 1}, e: {r: workPlanFlag_4, c: 2}},
        {s: {r: workPlanFlag_3_5+1, c: 3}, e: {r: workPlanFlag_4, c: 4}},
        {s: {r: workPlanFlag_3_5+1, c: 5}, e: {r: workPlanFlag_4, c: 6}},

        {s: {r: workPlanFlag_4+1, c: 1}, e: {r: workPlanFlag_5, c: 2}},
        {s: {r: workPlanFlag_4+1, c: 3}, e: {r: workPlanFlag_5, c: 4}},
        {s: {r: workPlanFlag_4+1, c: 5}, e: {r: workPlanFlag_5, c: 6}},

        {s: {r: workPlanFlag_5+1, c: 1}, e: {r: workPlanFlag_6, c: 2}},
        {s: {r: workPlanFlag_5+1, c: 3}, e: {r: workPlanFlag_6, c: 4}},
        {s: {r: workPlanFlag_5+1, c: 5}, e: {r: workPlanFlag_6, c: 6}},

        {s: {r: workPlanFlag_6+1, c: 1}, e: {r: workPlanFlag_7, c: 2}},
        {s: {r: workPlanFlag_6+1, c: 3}, e: {r: workPlanFlag_7, c: 4}},
        {s: {r: workPlanFlag_6+1, c: 5}, e: {r: workPlanFlag_7, c: 6}},

        {s: {r: workPlanFlag_7+1, c: 1}, e: {r: workPlanFlag_8, c: 2}},
        {s: {r: workPlanFlag_7+1, c: 3}, e: {r: workPlanFlag_8, c: 4}},
        {s: {r: workPlanFlag_7+1, c: 5}, e: {r: workPlanFlag_8, c: 6}},
    ];
    for(var i = 10; i < workPlanFlag_8+1; i++) {
        var mergesObj = {s: {r: i, c: 7}, e: {r: i, c: 8}};
        sheet2['!merges'].push(mergesObj);
    }

    var planDay = 0;
    for(var i = 1; i < peoplePlanDay.length; i++) {
        planDay += peoplePlanDay[i];
    }

    XLSX.utils.sheet_add_aoa(sheet2, [
        [null, "合计 : ", null, null, null, null, null, null, null, planDay]
    ], {origin: -1});
    sheet2['!merges'].push(
        {s: {r: workPlanFlag_8+1, c: 1}, e: {r: workPlanFlag_8+1, c: 8}}
    );

    var table5 = [
        [null,null,null,null,null, null, null, null, null,  null, null, null, null, null, null],
        [null, projectName,   null, null, null, null, null, null, null,  null, null, null, null, null, null],
        [null, "价格明细表", null, null, null, null, null, null, null,  null, null, null, null, null, null],
        [null, "软件开发", null, null, null, null, null, null,  null, null, null, null, null, null],
        [null, "一级系统",  '二级系统', '项目端', '核心功能描述', null, null, null, null, '小计(元)','投入岗位', '人数', '人日', '单价(元)', '小计(元)'],
    ];
    var sheet6 = XLSX.utils.aoa_to_sheet(table5);
    sheet6['!merges']= [
        {s: {r: 1, c: 1},  e: {r: 1, c: 14}},
        {s: {r: 2, c: 1},  e: {r: 2, c: 14}},
        {s: {r: 3, c: 1},  e: {r: 3, c: 14}},
        {s: {r: 4, c: 4},  e: {r: 4, c: 8}},
    ];
    var s6Flag = 5;
    var s6TotalT = "";

    var funNameArr = new Array();
    var funNum;
    var funMsgArr = new Array();
    var funMsg = data.System1.projectName + "需要搭建基础平台架构组件分别有以下: "+ '\n';
    if(system2fun.s1.funNum != 0 && system2fun.s1.funNum != null) {
        funNameArr = system2fun.s1.funName.split('_');
        funNum = system2fun.s1.funNum;
        funMsgArr = system2fun.s1.funMsg.split('/');
        for(var i = 0; i < funNum; i++)
            funMsg += funNameArr[i] + ": " + funMsgArr[i] + '\n';
    }
    var jobArr = system2job.s1;
    var numArr = new Array();
    var planDayArr = new Array();
    var totalDayArr = new Array();
    var money = new Array();
    if(system2job.s1.length != 0) {
        for(let i = 0; i < 13; i++) {
            numArr.push(jobArr[i].num != null ? jobArr[i].num : "");
            planDayArr.push(jobArr[i].planDay);
            totalDayArr.push(jobArr[i].totalDay);
            money.push(jobArr[i].money);
        }
    }

    XLSX.utils.sheet_add_aoa(sheet2, [
        [null, "价格明细表", null, null, null, null, null, null, null,  null],
        [null, "一、搭建平台架构", null, null, null, null, null, null,  null],
        [null, "一级系统",  '二级系统', '项目端', '核心功能描述', null, null, '投入岗位',           '人数',       '人日', '财务计价不含税人日'],
        [null, projectName, '基础平台', '组件',    funMsg,        null, null, '产品经理',           numArr[0],   planDayArr[0],  totalDayArr[0]],
        [null, null,        null,        null,     null,          null, null, '需求分析师',         numArr[1],   planDayArr[1],  totalDayArr[1]],
        [null, null,        null,        null,     null,          null, null, '应用架构设计师',     numArr[2],   planDayArr[2],  totalDayArr[2]],
        [null, null,        null,        null,     null,          null, null, '基础平台设计师',     numArr[3],   planDayArr[3],  totalDayArr[3]],
        [null, null,        null,        null,     null,          null, null, '客户端（app）设计师',numArr[4],   planDayArr[4],  totalDayArr[4]],
        [null, null,        null,        null,     null,          null, null, '前端设计设计师',     numArr[5],   planDayArr[5],  totalDayArr[5]],
        [null, null,        null,        null,     null,          null, null, 'UI设计师',           numArr[6],   planDayArr[6],  totalDayArr[6]],
        [null, null,        null,        null,     null,          null, null, 'java开发工程师',     numArr[7],   planDayArr[7],  totalDayArr[7]],
        [null, null,        null,        null,     null,          null, null, '安卓开发工程师',     numArr[8],   planDayArr[8],  totalDayArr[8]],
        [null, null,        null,        null,     null,          null, null, '苹果开发工程师',     numArr[9],   planDayArr[9],  totalDayArr[9]],
        [null, null,        null,        null,     null,          null, null, 'C#开发工程师',       numArr[10],  planDayArr[10], totalDayArr[10]],
        [null, null,        null,        null,     null,          null, null, '前端开发工程师',     numArr[11],  planDayArr[11], totalDayArr[11]],
        [null, null,        null,        null,     null,          null, null, '测试工程师',         numArr[12],  planDayArr[12], totalDayArr[12]],
        [null, "二、软件开发", null, null, null, null, null, null, null],
        [null, "一级系统",  '二级系统', '项目端', '核心功能描述', null, null, '投入岗位',           '人数',       '人日', '财务计价不含税人日'],
    ], {origin: -1});

    var detailsMsgFlag = workPlanFlag_8+1+1;
    sheet2['!merges'].push({s: {r: detailsMsgFlag, c: 1}, e: {r: detailsMsgFlag, c: 9}});
    sheet2['!merges'].push({s: {r: detailsMsgFlag+1, c: 1}, e: {r: detailsMsgFlag+1, c: 9}});
    sheet2['!merges'].push({s: {r: detailsMsgFlag+2, c: 4}, e: {r: detailsMsgFlag+2, c: 6}});
    sheet2['!merges'].push({s: {r: detailsMsgFlag+3, c: 1}, e: {r: detailsMsgFlag+15, c: 1}});
    sheet2['!merges'].push({s: {r: detailsMsgFlag+3, c: 2}, e: {r: detailsMsgFlag+15, c: 2}});
    sheet2['!merges'].push({s: {r: detailsMsgFlag+3, c: 3}, e: {r: detailsMsgFlag+15, c: 3}});
    sheet2['!merges'].push({s: {r: detailsMsgFlag+3, c: 4}, e: {r: detailsMsgFlag+15, c: 6}});
    sheet2['!merges'].push({s: {r: detailsMsgFlag+16, c: 1}, e: {r: detailsMsgFlag+16, c: 9}});

    var table2 = [
        [null,null,null,null,null, null, null, null, null,  null, null, null, null, null, null],
        [null, projectName,   null, null, null, null, null, null, null,  null, null, null, null, null, null],
        [null, "价格明细表", null, null, null, null, null, null, null,  null, null, null, null, null, null],
        [null, "一、搭建平台架构", null, null, null, null, null, null,  null, null, null, null, null, null],
        [null, "一级系统",  '二级系统', '项目端', '核心功能描述', null, null, null, null, '小计(元)','投入岗位', '人数', '人日', '单价(元)', '小计(元)'],
        [null, projectName, '基础平台', '组件', funMsg, null, null, null, null, null,'产品经理',           numArr[0],   totalDayArr[0], money[0],   null],
        [null, null,        null,        null,  null,   null, null, null, null, null,'需求分析师',         numArr[1],   totalDayArr[1], money[1],   null],
        [null, null,        null,        null,  null,   null, null, null, null, null,'应用架构设计师',     numArr[2],   totalDayArr[2], money[2],   null],
        [null, null,        null,        null,  null,   null, null, null, null, null,'基础平台设计师',     numArr[3],   totalDayArr[3], money[3],   null],
        [null, null,        null,        null,  null,   null, null, null, null, null,'客户端（app）设计师',numArr[4],   totalDayArr[4], money[4],   null],
        [null, null,        null,        null,  null,   null, null, null, null, null,'前端设计设计师',     numArr[5],   totalDayArr[5], money[5],   null],
        [null, null,        null,        null,  null,   null, null, null, null, null,'UI设计师',           numArr[6],   totalDayArr[6], money[6],   null],
        [null, null,        null,        null,  null,   null, null, null, null, null,'java开发工程师',     numArr[7],   totalDayArr[7], money[7],   null],
        [null, null,        null,        null,  null,   null, null, null, null, null,'安卓开发工程师',     numArr[8],   totalDayArr[8], money[8],   null],
        [null, null,        null,        null,  null,   null, null, null, null, null,'苹果开发工程师',     numArr[9],   totalDayArr[9], money[9],   null],
        [null, null,        null,        null,  null,   null, null, null, null, null,'C#开发工程师',       numArr[10],  totalDayArr[10],money[10],  null],
        [null, null,        null,        null,  null,   null, null, null, null, null,'前端开发工程师',     numArr[11],  totalDayArr[11],money[11],  null],
        [null, null,        null,        null,  null,   null, null, null, null, null,'测试工程师',         numArr[12],  totalDayArr[12],money[12],  null],
        [null, "小计: ", null, null, null, null, null, null,null, null,  null,null, null, null, null, null, null],
        [null, "二、软件开发", null, null, null, null, null, null,null, null,  null,null, null, null, null, null, null],
        [null, "一级系统",  '二级系统', '项目端', '核心功能描述', null, null, null, null, '小计(元)','投入岗位', '人数','人日', '单价(元)','小计(元)'],
    ];
    var sheet3 = XLSX.utils.aoa_to_sheet(table2);
    var sheet3Flag = 21;
    sheet3['!merges']= [
        {s: {r: 1, c: 1},  e: {r: 1, c: 14}},
        {s: {r: 2, c: 1},  e: {r: 2, c: 14}},
        {s: {r: 3, c: 1},  e: {r: 3, c: 14}},
        {s: {r: 5, c: 1},  e: {r: 17, c: 1}},
        {s: {r: 5, c: 2},  e: {r: 17, c: 2}},
        {s: {r: 5, c: 3},  e: {r: 17, c: 3}},
        {s: {r: 5, c: 9},  e: {r: 17, c: 9}},
        {s: {r: 4, c: 4},  e: {r: 4, c: 8}},
        {s: {r: 5, c: 4},  e: {r: 17, c: 8}},
        {s: {r: 18, c: 1},  e: {r: 18, c: 8}},
        {s: {r: 18, c: 10}, e: {r: 18, c: 14}},
        {s: {r: 19, c: 1},  e: {r: 19, c: 14}},
        {s: {r: 20, c: 4},  e: {r: 20, c: 8}},
    ];
    for(var i = 6; i <= 18; i++){
        var n = "N"+i;
        var m = "M"+i;
        var o = "O"+i;
        sheet3[o] = { t:'n', f: n+'*'+m, F:o };
    }
    sheet3['J6'] = { t: 'n', f: 'SUM(O6:O18)', F:'J6'};
    sheet3['J19'] = { t: 'n', f: 'J6', F:'J19'};

    var table3 = [
        [null, "项目名称",   null,                 null, null, projectName+"产品软件",  null,   null,   null,     null,   null, null],
        [null,  "价 格 表",  null,                 null, null, null,         null,      null,   null,   null,     null,   null],
        [null, "序号",      "产品名称",            null, null, null,         "单位",    null,   "数量", null,    "单价",  "价格(元)"],
        [null, "（1）",      projectName+"产品",   null, null, null,         "套",      null,   1,      null,     null,   null],
        [null, "（2）",      "业务支撑",           null, null, null,         "项",      null,   1,      null,     null,   null],
        [null, "（3）",      "系统实施",           null, null, null,         "项",      null,   1,      null,     null,   null],
        [null, "（4）",      "项目管理",           null, null, null,         "项",      null,   1,      null,     null,   null],
        [null, "（5）",      "技术管理",           null, null, null,         "项",      null,   1,      null,     null,   null],
        [null, "含税总价=(1)+(2)+(3)+(4)+(5)", null, null, "(小写)", null, null, null, null, null, null, null],
        [null, null,                           null, null, "(大写)", null, null, null, null, null, null, null],
        [null, null,                           null, null, null,     null, null, null, null, null, null, null],
        [null, projectName+"产品-价格明细表",  null, null, null,     null, null, null, null, null, null, null],
        [null, "一、搭建平台架构",             null, null, null,     null, null, null, null, null, null, null],
        [null, "一级系统", "二级系统", "项目", "功能", null, "规格型号", "质保期", "单位", "数量", "单价(元)", "小计(元)"],
    ];
    var sheet4 = XLSX.utils.aoa_to_sheet(table3);
    var sheet4Flag = 14;
    sheet4['!merges']= [
        {s: {r: 0, c: 1},  e: {r: 0, c: 4}},
        {s: {r: 0, c: 5},  e: {r: 0, c: 11}},
        {s: {r: 1, c: 1},  e: {r: 1, c: 11}},
        {s: {r: 2, c: 2},  e: {r: 2, c: 5}},
        {s: {r: 2, c: 6},  e: {r: 2, c: 7}},
        {s: {r: 2, c: 8},  e: {r: 2, c: 9}},
        {s: {r: 3, c: 2},  e: {r: 3, c: 5}},
        {s: {r: 3, c: 6},  e: {r: 3, c: 7}},
        {s: {r: 3, c: 8},  e: {r: 3, c: 9}},
        {s: {r: 4, c: 2},  e: {r: 4, c: 5}},
        {s: {r: 4, c: 6},  e: {r: 4, c: 7}},
        {s: {r: 4, c: 8},  e: {r: 4, c: 9}},
        {s: {r: 5, c: 2},  e: {r: 5, c: 5}},
        {s: {r: 5, c: 6},  e: {r: 5, c: 7}},
        {s: {r: 5, c: 8},  e: {r: 5, c: 9}},
        {s: {r: 6, c: 2},  e: {r: 6, c: 5}},
        {s: {r: 6, c: 6},  e: {r: 6, c: 7}},
        {s: {r: 6, c: 8},  e: {r: 6, c: 9}},
        {s: {r: 7, c: 2},  e: {r: 7, c: 5}},
        {s: {r: 7, c: 6},  e: {r: 7, c: 7}},
        {s: {r: 7, c: 8},  e: {r: 7, c: 9}},
        {s: {r: 8, c: 1},  e: {r: 9, c: 3}},
        {s: {r: 8, c: 5},  e: {r: 8, c: 11}},
        {s: {r: 9, c: 5},  e: {r: 9, c: 11}},
        {s: {r: 10, c: 1},  e: {r: 10, c: 11}},
        {s: {r: 11, c: 1},  e: {r: 11, c: 11}},
        {s: {r: 12, c: 1},  e: {r: 12, c: 11}},
        {s: {r: 13, c: 4},  e: {r: 13, c: 5}},
    ];
    var s4t = "K"+15;
    var s4t2 = "L"+15;
    if(system2fun.s1.funNum != 0 && system2fun.s1.funNum != null) {
        var s4N = sheet4Flag;
        XLSX.utils.sheet_add_aoa(sheet4, [
            [null, projectName, "基础平台", funNameArr[0], funMsgArr[0], null, null, null, '套', null, systemTotalNum[0], null],
        ], {origin: -1});
        sheet4['!merges'].push({s: {r: sheet4Flag, c: 4},  e: {r: sheet4Flag, c: 5}});
        sheet4Flag++
        for(var i = 1; i < funNum; i++, sheet4Flag++) {
            XLSX.utils.sheet_add_aoa(sheet4, [
                [null, null, null, funNameArr[i], funMsgArr[i], null, null, null, null, null, null, null],
            ], {origin: -1});
            sheet4['!merges'].push({s: {r: sheet4Flag, c: 4},  e: {r: sheet4Flag, c: 5}});
        }
        sheet4Flag--;
        sheet4['!merges'].push({s: {r: s4N, c: 1},  e: {r: sheet4Flag+1, c: 1}});
        sheet4['!merges'].push({s: {r: s4N, c: 2},  e: {r: sheet4Flag, c: 2}});
        sheet4['!merges'].push({s: {r: s4N, c: 6},  e: {r: sheet4Flag, c: 6}});
        sheet4['!merges'].push({s: {r: s4N, c: 7},  e: {r: sheet4Flag, c: 7}});
        sheet4['!merges'].push({s: {r: s4N, c: 8},  e: {r: sheet4Flag, c: 8}});
        sheet4['!merges'].push({s: {r: s4N, c: 9},  e: {r: sheet4Flag, c: 9}});
        sheet4['!merges'].push({s: {r: s4N, c: 10},  e: {r: sheet4Flag, c: 10}});
        sheet4['!merges'].push({s: {r: s4N, c: 11},  e: {r: sheet4Flag, c: 11}});
        sheet4Flag++;
    }

    var flagArr = new Array();
    flagArr.push(getFlagNum(system2job.s41, system2fun.s41));
    flagArr.push(getFlagNum(system2job.s42, system2fun.s42));
    flagArr.push(getFlagNum(system2job.s43, system2fun.s43));
    flagArr.push(getFlagNum(system2job.s44, system2fun.s44));
    flagArr.push(getFlagNum(system2job.s45, system2fun.s45));
    var f = 0;
    var k = 0;

    var jobText = new Array();
    jobText.push("", "产品经理", "需求分析师", "应用架构师", "基础平台设计师", "客户端（app）设计师",
        "前端设计设计师", "UI设计师", "java开发工程师", "安卓开发工程师", "苹果开发工程师", "C#开发工程师",
        "前端开发工程师", "测试工程师");

    if(flagArr[0] != 0) {
        f = 1;
        k++;
        funMsg = "";
        if(system2fun.s41.funNum != 0 && system2fun.s41.funNum != null) {
            funNameArr = system2fun.s41.funName.split('_');
            funNum = system2fun.s41.funNum;
            funMsgArr = system2fun.s41.funMsg.split('/');
            for(var i = 0; i < funNum; i++)
                funMsg += funNameArr[i] + ": " + funMsgArr[i] + '\n';
        }
        jobArr = system2job.s41;
        numArr = new Array();
        planDayArr = new Array();
        totalDayArr = new Array();
        money = new Array();
        if(system2job.s41.length != 0) {
            for(let i = 0; i < 13; i++) {
                numArr.push(jobArr[i].num != null ? jobArr[i].num : "");
                planDayArr.push(jobArr[i].planDay);
                totalDayArr.push(jobArr[i].totalDay);
                money.push(jobArr[i].money);
            }
        }
        XLSX.utils.sheet_add_aoa(sheet2, [
            [null, projectName, '应用层',  '小程序端',   funMsg,  null, null, '产品经理',          numArr[0],   planDayArr[0],  totalDayArr[0]],
            [null, null,        null,        null,     null,      null, null, '需求分析师',        numArr[1],   planDayArr[1],  totalDayArr[1]],
            [null, null,        null,        null,     null,      null, null, '应用架构设计师',    numArr[2],   planDayArr[2],  totalDayArr[2]],
            [null, null,        null,        null,     null,      null, null, '基础平台设计师',    numArr[3],   planDayArr[3],  totalDayArr[3]],
            [null, null,        null,        null,     null,      null, null, '客户端（app）设计师',numArr[4],   planDayArr[4],  totalDayArr[4]],
            [null, null,        null,        null,     null,      null, null, '前端设计设计师',    numArr[5],   planDayArr[5],  totalDayArr[5]],
            [null, null,        null,        null,     null,      null, null, 'UI设计师',          numArr[6],   planDayArr[6],  totalDayArr[6]],
            [null, null,        null,        null,     null,      null, null, 'java开发工程师',    numArr[7],   planDayArr[7],  totalDayArr[7]],
            [null, null,        null,        null,     null,      null, null, '安卓开发工程师',    numArr[8],   planDayArr[8],  totalDayArr[8]],
            [null, null,        null,        null,     null,      null, null, '苹果开发工程师',    numArr[9],   planDayArr[9],  totalDayArr[9]],
            [null, null,        null,        null,     null,      null, null, 'C#开发工程师',     numArr[10],  planDayArr[10], totalDayArr[10]],
            [null, null,        null,        null,     null,      null, null, '前端开发工程师',   numArr[11],  planDayArr[11], totalDayArr[11]],
            [null, null,        null,        null,     null,      null, null, '测试工程师',       numArr[12],  planDayArr[12], totalDayArr[12]]
        ], {origin: -1});
        detailsMsgFlag += 17;
        sheet2['!merges'].push({s: {r: detailsMsgFlag, c: 4}, e: {r: detailsMsgFlag, c: 6}});
        sheet2['!merges'].push({s: {r: detailsMsgFlag, c: 1}, e: {r: detailsMsgFlag+13, c: 1}});
        sheet2['!merges'].push({s: {r: detailsMsgFlag+1, c: 2}, e: {r: detailsMsgFlag+13, c: 2}});
        sheet2['!merges'].push({s: {r: detailsMsgFlag+1, c: 3}, e: {r: detailsMsgFlag+13, c: 3}});
        sheet2['!merges'].push({s: {r: detailsMsgFlag+1, c: 4}, e: {r: detailsMsgFlag+13, c: 6}});

        XLSX.utils.sheet_add_aoa(sheet3, [
            [null, projectName, '应用层', '小程序端', funMsg,  null, null, null, null, null,'产品经理',   numArr[0],   totalDayArr[0], money[0],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'需求分析师',         numArr[1],   totalDayArr[1], money[1],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'应用架构设计师',     numArr[2],   totalDayArr[2], money[2],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'基础平台设计师',     numArr[3],   totalDayArr[3], money[3],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'客户端（app）设计师',numArr[4],   totalDayArr[4], money[4],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'前端设计设计师',     numArr[5],   totalDayArr[5], money[5],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'UI设计师',           numArr[6],   totalDayArr[6], money[6],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'java开发工程师',     numArr[7],   totalDayArr[7], money[7],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'安卓开发工程师',     numArr[8],   totalDayArr[8], money[8],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'苹果开发工程师',     numArr[9],   totalDayArr[9], money[9],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'C#开发工程师',       numArr[10],  totalDayArr[10],money[10],  null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'前端开发工程师',     numArr[11],  totalDayArr[11],money[11],  null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'测试工程师',         numArr[12],  totalDayArr[12],money[12],  null],
        ], {origin: -1});

        sheet3['!merges'].push({s: {r: sheet3Flag, c: 1}, e: {r: sheet3Flag+13, c: 1}});
        sheet3['!merges'].push({s: {r: sheet3Flag, c: 2}, e: {r: sheet3Flag+12, c: 2}});
        sheet3['!merges'].push({s: {r: sheet3Flag, c: 3}, e: {r: sheet3Flag+12, c: 3}});
        sheet3['!merges'].push({s: {r: sheet3Flag, c: 4}, e: {r: sheet3Flag+12, c: 8}});
        sheet3['!merges'].push({s: {r: sheet3Flag, c: 9}, e: {r: sheet3Flag+12, c: 9}});
        for(var i = 22; i <= 34; i++){
            var n = "N"+i;
            var m = "M"+i;
            var o = "O"+i;
            sheet3[o] = { t:'n', f: n+'*'+m, F:o };
        }
        sheet3['J22'] = { t: 'n', f: 'SUM(O22:O34)', F:'J22'};

        var s6f = 0;
        var s6t = "";
        var s6FunMsg = "";
        var s6TempFlag = s6Flag;
        for(var i = 0; i < funNum; i++)
            s6FunMsg += funNameArr[i] + "（" + funMsgArr[i] + '）、';
        s6FunMsg = s6FunMsg.substr(0, s6FunMsg.length-1);
        if(jobArr.length != 0) {
            for(var i = 0; i < jobArr.length; i++) {
                if(numArr[i] != "" && totalDayArr[i] != null) {
                    console.log(jobArr[i]);
                    s6TempFlag++;
                    if(s6f == 0) {
                        s6f = 1;
                        XLSX.utils.sheet_add_aoa(sheet6, [
                            [null, projectName,  projectName, '小程序', s6FunMsg, null, null, null, null, null, jobText[jobArr[i].site], jobArr[i].num, jobArr[i].totalDay, jobArr[i].money, null],
                        ], {origin: -1});
                    } else {
                        XLSX.utils.sheet_add_aoa(sheet6, [
                            [null, null,  null, null, null, null, null, null, null, null, jobText[jobArr[i].site], jobArr[i].num, jobArr[i].totalDay, jobArr[i].money, null],
                        ], {origin: -1});
                    }
                }
            }
        } else {
            XLSX.utils.sheet_add_aoa(sheet6, [
                [null, projectName,  projectName, '小程序', s6FunMsg, null, null, null, null, null, null, null, null, null, null],], {origin: -1});
        }
        for(var i = s6Flag+1; i <= s6TempFlag+1; i++) {
            s6t += "O"+i+"+";
        }
        s6t = s6t.substr(0, s6t.length-1);
        sheet6['J'+(s6Flag+1)] = { t:'n', f: s6t, F:'J'+(s6Flag+1) };
        s6TotalT += "J"+(s6Flag+1)+"+";
        s6TempFlag = s6TempFlag != s6Flag ? s6TempFlag-1 : s6Flag;
        sheet6['!merges'].push({s: {r: s6Flag, c: 1},  e: {r: s6TempFlag+1, c: 1}});
        sheet6['!merges'].push({s: {r: s6Flag, c: 2},  e: {r: s6TempFlag+1, c: 2}});
        sheet6['!merges'].push({s: {r: s6Flag, c: 3},  e: {r: s6TempFlag, c: 3}});
        sheet6['!merges'].push({s: {r: s6Flag, c: 4},  e: {r: s6TempFlag, c: 8}});
        sheet6['!merges'].push({s: {r: s6Flag, c: 9},  e: {r: s6TempFlag, c: 9}});
        s6Flag = s6TempFlag+1;

        if(system2fun.s41.funNum != 0 && system2fun.s41.funNum != null) {
            var s4N = sheet4Flag;
            s4t += "+"+"K"+s4N;
            s4t2 += "+"+"L"+s4N;
            XLSX.utils.sheet_add_aoa(sheet4, [
                [null, projectName, "小程序", funNameArr[0], funMsgArr[0], null, null, null, '套', null, systemTotalNum[3], null],
            ], {origin: -1});
            sheet4['!merges'].push({s: {r: sheet4Flag, c: 4},  e: {r: sheet4Flag, c: 5}});
            sheet4Flag++
            for(var i = 1; i < funNum; i++, sheet4Flag++) {
                XLSX.utils.sheet_add_aoa(sheet4, [
                    [null, null, null, funNameArr[i], funMsgArr[i], null, null, null, null, null, null, null],
                ], {origin: -1});
                sheet4['!merges'].push({s: {r: sheet4Flag, c: 4},  e: {r: sheet4Flag, c: 5}});
            }
            sheet4Flag--;
            sheet4['!merges'].push({s: {r: s4N, c: 1},  e: {r: sheet4Flag+1, c: 1}});
            sheet4['!merges'].push({s: {r: s4N, c: 2},  e: {r: sheet4Flag, c: 2}});
            sheet4['!merges'].push({s: {r: s4N, c: 6},  e: {r: sheet4Flag, c: 6}});
            sheet4['!merges'].push({s: {r: s4N, c: 7},  e: {r: sheet4Flag, c: 7}});
            sheet4['!merges'].push({s: {r: s4N, c: 8},  e: {r: sheet4Flag, c: 8}});
            sheet4['!merges'].push({s: {r: s4N, c: 9},  e: {r: sheet4Flag, c: 9}});
            sheet4['!merges'].push({s: {r: s4N, c: 10},  e: {r: sheet4Flag, c: 10}});
            sheet4['!merges'].push({s: {r: s4N, c: 11},  e: {r: sheet4Flag, c: 11}});
            sheet4Flag++

            var s5FunMsg = "";
            for(var i = 0; i < funNum; i++)
                s5FunMsg += funNameArr[i] + "（" + funMsgArr[i] + '）、';
            s5FunMsg = s5FunMsg.substr(0, s5FunMsg.length-1);
            XLSX.utils.sheet_add_aoa(sheet5, [
                [null, projectName, projectName, "小程序", s5FunMsg, null, null, null, null],
            ], {origin: -1});
            sheet5['!merges'].push({s: {r: ++sheet5Flag, c: 4},  e: {r: sheet5Flag, c: 8}});
        }
    }

    if(flagArr[1] != 0) {
        funMsg = "";
        if(system2fun.s42.funNum != 0 && system2fun.s42.funNum != null) {
            funNameArr = system2fun.s42.funName.split('_');
            funNum = system2fun.s42.funNum;
            funMsgArr = system2fun.s42.funMsg.split('/');
            for(var i = 0; i < funNum; i++)
                funMsg += funNameArr[i] + ": " + funMsgArr[i] + '\n';
        }
        jobArr = system2job.s42;
        numArr = new Array();
        planDayArr = new Array();
        totalDayArr = new Array();
        money = new Array();
        if(system2job.s42.length != 0) {
            for(let i = 0; i < 13; i++) {
                numArr.push(jobArr[i].num != null ? jobArr[i].num : "");
                planDayArr.push(jobArr[i].planDay);
                totalDayArr.push(jobArr[i].totalDay);
                money.push(jobArr[i].money);
            }
        }
        XLSX.utils.sheet_add_aoa(sheet2, [
            [null, projectName, '应用层',  'H5端',   funMsg,   null, null, '产品经理',          numArr[0],   planDayArr[0],  totalDayArr[0]],
            [null, null,        null,        null,     null,   null, null, '需求分析师',        numArr[1],   planDayArr[1],  totalDayArr[1]],
            [null, null,        null,        null,     null,   null, null, '应用架构设计师',    numArr[2],   planDayArr[2],  totalDayArr[2]],
            [null, null,        null,        null,     null,   null, null, '基础平台设计师',    numArr[3],   planDayArr[3],  totalDayArr[3]],
            [null, null,        null,        null,     null,   null, null, '客户端（app）设计师',numArr[4],   planDayArr[4],  totalDayArr[4]],
            [null, null,        null,        null,     null,   null, null, '前端设计设计师',    numArr[5],   planDayArr[5],  totalDayArr[5]],
            [null, null,        null,        null,     null,   null, null, 'UI设计师',          numArr[6],   planDayArr[6],  totalDayArr[6]],
            [null, null,        null,        null,     null,   null, null, 'java开发工程师',    numArr[7],   planDayArr[7],  totalDayArr[7]],
            [null, null,        null,        null,     null,   null, null, '安卓开发工程师',    numArr[8],   planDayArr[8],  totalDayArr[8]],
            [null, null,        null,        null,     null,   null, null, '苹果开发工程师',    numArr[9],   planDayArr[9],  totalDayArr[9]],
            [null, null,        null,        null,     null,   null, null, 'C#开发工程师',     numArr[10],  planDayArr[10], totalDayArr[10]],
            [null, null,        null,        null,     null,   null, null, '前端开发工程师',   numArr[11],  planDayArr[11], totalDayArr[11]],
            [null, null,        null,        null,     null,   null, null, '测试工程师',       numArr[12],  planDayArr[12], totalDayArr[12]]
        ], {origin: -1});
        detailsMsgFlag += (f != 1 ? 17 : 13);
        f = 1;
        sheet2['!merges'].push({s: {r: detailsMsgFlag, c: 4}, e: {r: detailsMsgFlag, c: 6}});
        sheet2['!merges'].push({s: {r: detailsMsgFlag, c: 1}, e: {r: detailsMsgFlag+13, c: 1}});
        sheet2['!merges'].push({s: {r: detailsMsgFlag+1, c: 2}, e: {r: detailsMsgFlag+13, c: 2}});
        sheet2['!merges'].push({s: {r: detailsMsgFlag+1, c: 3}, e: {r: detailsMsgFlag+13, c: 3}});
        sheet2['!merges'].push({s: {r: detailsMsgFlag+1, c: 4}, e: {r: detailsMsgFlag+13, c: 6}});

        XLSX.utils.sheet_add_aoa(sheet3, [
            [null, projectName, '应用层',  'H5端',   funMsg, null, null, null, null, null,'产品经理',     numArr[0],   totalDayArr[0], money[0],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'需求分析师',         numArr[1],   totalDayArr[1], money[1],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'应用架构设计师',     numArr[2],   totalDayArr[2], money[2],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'基础平台设计师',     numArr[3],   totalDayArr[3], money[3],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'客户端（app）设计师',numArr[4],   totalDayArr[4], money[4],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'前端设计设计师',     numArr[5],   totalDayArr[5], money[5],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'UI设计师',           numArr[6],   totalDayArr[6], money[6],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'java开发工程师',     numArr[7],   totalDayArr[7], money[7],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'安卓开发工程师',     numArr[8],   totalDayArr[8], money[8],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'苹果开发工程师',     numArr[9],   totalDayArr[9], money[9],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'C#开发工程师',       numArr[10],  totalDayArr[10],money[10],  null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'前端开发工程师',     numArr[11],  totalDayArr[11],money[11],  null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'测试工程师',         numArr[12],  totalDayArr[12],money[12],  null],
        ], {origin: -1});

        sheet3Flag += (k != 0 ? 13 : 0);
        k++;
        sheet3['!merges'].push({s: {r: sheet3Flag, c: 1}, e: {r: sheet3Flag+13, c: 1}});
        sheet3['!merges'].push({s: {r: sheet3Flag, c: 2}, e: {r: sheet3Flag+12, c: 2}});
        sheet3['!merges'].push({s: {r: sheet3Flag, c: 3}, e: {r: sheet3Flag+12, c: 3}});
        sheet3['!merges'].push({s: {r: sheet3Flag, c: 4}, e: {r: sheet3Flag+12, c: 8}});
        sheet3['!merges'].push({s: {r: sheet3Flag, c: 9}, e: {r: sheet3Flag+12, c: 9}});
        for(var i = sheet3Flag+1; i <= sheet3Flag+13; i++){
            var n = "N"+i;
            var m = "M"+i;
            var o = "O"+i;
            sheet3[o] = { t:'n', f: n+'*'+m, F:o };
        }
        var OF1 = "O"+(sheet3Flag+1)
        var OF2 = "O"+(sheet3Flag+13)
        var sumF = 'SUM('+OF1+':'+OF2+')';
        sheet3['J'+(sheet3Flag+1)] = { t: 'n', f: sumF, F:'J'+(sheet3Flag+1)};

        var s6f = 0;
        var s6t = "";
        var s6FunMsg = "";
        var s6TempFlag = s6Flag;
        for(var i = 0; i < funNum; i++)
            s6FunMsg += funNameArr[i] + "（" + funMsgArr[i] + '）、';
        s6FunMsg = s6FunMsg.substr(0, s6FunMsg.length-1);
        if(jobArr.length != 0) {
            for(var i = 0; i < jobArr.length; i++) {
                if(numArr[i] != "" && totalDayArr[i] != null) {
                    console.log(jobArr[i]);
                    s6TempFlag++;
                    if(s6f == 0) {
                        s6f = 1;
                        XLSX.utils.sheet_add_aoa(sheet6, [
                            [null, projectName,  projectName, 'H5端', s6FunMsg, null, null, null, null, null, jobText[jobArr[i].site], jobArr[i].num, jobArr[i].totalDay, jobArr[i].money, null],
                        ], {origin: -1});
                    } else {
                        XLSX.utils.sheet_add_aoa(sheet6, [
                            [null, null,  null, null, null, null, null, null, null, null, jobText[jobArr[i].site], jobArr[i].num, jobArr[i].totalDay, jobArr[i].money, null],
                        ], {origin: -1});
                    }
                }
            }
        } else {
            XLSX.utils.sheet_add_aoa(sheet6, [
                [null, projectName,  projectName, 'H5端', s6FunMsg, null, null, null, null, null, null, null, null, null, null],], {origin: -1});
        }
        for(var i = s6Flag+1; i <= s6TempFlag+1; i++) {
            s6t += "O"+i+"+";
        }
        s6t = s6t.substr(0, s6t.length-1);
        sheet6['J'+(s6Flag+1)] = { t:'n', f: s6t, F:'J'+(s6Flag+1) };
        s6TempFlag = s6TempFlag != s6Flag ? s6TempFlag-1 : s6Flag;
        s6TotalT += "J"+(s6Flag+1)+"+";
        sheet6['!merges'].push({s: {r: s6Flag, c: 1},  e: {r: s6TempFlag+1, c: 1}});
        sheet6['!merges'].push({s: {r: s6Flag, c: 2},  e: {r: s6TempFlag+1, c: 2}});
        sheet6['!merges'].push({s: {r: s6Flag, c: 3},  e: {r: s6TempFlag, c: 3}});
        sheet6['!merges'].push({s: {r: s6Flag, c: 4},  e: {r: s6TempFlag, c: 8}});
        sheet6['!merges'].push({s: {r: s6Flag, c: 9},  e: {r: s6TempFlag, c: 9}});
        s6Flag = s6TempFlag+1;

        if(system2fun.s2.funNum != 0 && system2fun.s2.funNum != null) {
            var s4N = sheet4Flag;
            s4t += "+"+"K"+s4N;
            s4t2 += "+"+"L"+s4N;
            XLSX.utils.sheet_add_aoa(sheet4, [
                [null, projectName, "H5", funNameArr[0], funMsgArr[0], null, null, null, '套', null, systemTotalNum[4], null],
            ], {origin: -1});
            sheet4['!merges'].push({s: {r: sheet4Flag, c: 4},  e: {r: sheet4Flag, c: 5}});
            sheet4Flag++
            for(var i = 1; i < funNum; i++, sheet4Flag++) {
                XLSX.utils.sheet_add_aoa(sheet4, [
                    [null, null, null, funNameArr[i], funMsgArr[i], null, null, null, null, null, null, null],
                ], {origin: -1});
                sheet4['!merges'].push({s: {r: sheet4Flag, c: 4},  e: {r: sheet4Flag, c: 5}});
            }
            sheet4Flag--;
            sheet4['!merges'].push({s: {r: s4N, c: 1},  e: {r: sheet4Flag+1, c: 1}});
            sheet4['!merges'].push({s: {r: s4N, c: 2},  e: {r: sheet4Flag, c: 2}});
            sheet4['!merges'].push({s: {r: s4N, c: 6},  e: {r: sheet4Flag, c: 6}});
            sheet4['!merges'].push({s: {r: s4N, c: 7},  e: {r: sheet4Flag, c: 7}});
            sheet4['!merges'].push({s: {r: s4N, c: 8},  e: {r: sheet4Flag, c: 8}});
            sheet4['!merges'].push({s: {r: s4N, c: 9},  e: {r: sheet4Flag, c: 9}});
            sheet4['!merges'].push({s: {r: s4N, c: 10},  e: {r: sheet4Flag, c: 10}});
            sheet4['!merges'].push({s: {r: s4N, c: 11},  e: {r: sheet4Flag, c: 11}});
            sheet4Flag++

            var s5FunMsg = "";
            for(var i = 0; i < funNum; i++)
                s5FunMsg += funNameArr[i] + "（" + funMsgArr[i] + '）、';
            s5FunMsg = s5FunMsg.substr(0, s5FunMsg.length-1);
            XLSX.utils.sheet_add_aoa(sheet5, [
                [null, projectName, projectName, "H5端", s5FunMsg, null, null, null, null],
            ], {origin: -1});
            sheet5['!merges'].push({s: {r: ++sheet5Flag, c: 4},  e: {r: sheet5Flag, c: 8}});
        }
    }

    if(flagArr[2] != 0) {
        funMsg = "";
        if(system2fun.s43.funNum != 0 && system2fun.s43.funNum != null) {
            funNameArr = system2fun.s43.funName.split('_');
            funNum = system2fun.s43.funNum;
            funMsgArr = system2fun.s43.funMsg.split('/');
            for(var i = 0; i < funNum; i++)
                funMsg += funNameArr[i] + ": " + funMsgArr[i] + '\n';
        }
        jobArr = system2job.s43;
        numArr = new Array();
        planDayArr = new Array();
        totalDayArr = new Array();
        money = new Array();
        if(system2job.s43.length != 0) {
            for(let i = 0; i < 13; i++) {
                numArr.push(jobArr[i].num != null ? jobArr[i].num : "");
                planDayArr.push(jobArr[i].planDay);
                totalDayArr.push(jobArr[i].totalDay);
                money.push(jobArr[i].money);
            }
        }
        XLSX.utils.sheet_add_aoa(sheet2, [
            [null, projectName, '应用层',  '客户端app',   funMsg, null, null, '产品经理',         numArr[0],   planDayArr[0],  totalDayArr[0]],
            [null, null,        null,        null,     null,      null, null, '需求分析师',        numArr[1],   planDayArr[1],  totalDayArr[1]],
            [null, null,        null,        null,     null,      null, null, '应用架构设计师',    numArr[2],   planDayArr[2],  totalDayArr[2]],
            [null, null,        null,        null,     null,      null, null, '基础平台设计师',    numArr[3],   planDayArr[3],  totalDayArr[3]],
            [null, null,        null,        null,     null,      null, null, '客户端（app）设计师',numArr[4],   planDayArr[4],  totalDayArr[4]],
            [null, null,        null,        null,     null,      null, null, '前端设计设计师',    numArr[5],   planDayArr[5],  totalDayArr[5]],
            [null, null,        null,        null,     null,      null, null, 'UI设计师',          numArr[6],   planDayArr[6],  totalDayArr[6]],
            [null, null,        null,        null,     null,      null, null, 'java开发工程师',    numArr[7],   planDayArr[7],  totalDayArr[7]],
            [null, null,        null,        null,     null,      null, null, '安卓开发工程师',    numArr[8],   planDayArr[8],  totalDayArr[8]],
            [null, null,        null,        null,     null,      null, null, '苹果开发工程师',    numArr[9],   planDayArr[9],  totalDayArr[9]],
            [null, null,        null,        null,     null,      null, null, 'C#开发工程师',     numArr[10],  planDayArr[10], totalDayArr[10]],
            [null, null,        null,        null,     null,      null, null, '前端开发工程师',   numArr[11],  planDayArr[11], totalDayArr[11]],
            [null, null,        null,        null,     null,      null, null, '测试工程师',       numArr[12],  planDayArr[12], totalDayArr[12]]
        ], {origin: -1});
        detailsMsgFlag += (f != 1 ? 17 : 13);
        f = 1;
        sheet2['!merges'].push({s: {r: detailsMsgFlag, c: 4}, e: {r: detailsMsgFlag, c: 6}});
        sheet2['!merges'].push({s: {r: detailsMsgFlag, c: 1}, e: {r: detailsMsgFlag+13, c: 1}});
        sheet2['!merges'].push({s: {r: detailsMsgFlag+1, c: 2}, e: {r: detailsMsgFlag+13, c: 2}});
        sheet2['!merges'].push({s: {r: detailsMsgFlag+1, c: 3}, e: {r: detailsMsgFlag+13, c: 3}});
        sheet2['!merges'].push({s: {r: detailsMsgFlag+1, c: 4}, e: {r: detailsMsgFlag+13, c: 6}});

        XLSX.utils.sheet_add_aoa(sheet3, [
            [null, projectName, '应用层',  '客户端app',   funMsg, null, null, null, null, null,'产品经理',numArr[0],   totalDayArr[0], money[0],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'需求分析师',         numArr[1],   totalDayArr[1], money[1],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'应用架构设计师',     numArr[2],   totalDayArr[2], money[2],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'基础平台设计师',     numArr[3],   totalDayArr[3], money[3],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'客户端（app）设计师',numArr[4],   totalDayArr[4], money[4],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'前端设计设计师',     numArr[5],   totalDayArr[5], money[5],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'UI设计师',           numArr[6],   totalDayArr[6], money[6],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'java开发工程师',     numArr[7],   totalDayArr[7], money[7],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'安卓开发工程师',     numArr[8],   totalDayArr[8], money[8],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'苹果开发工程师',     numArr[9],   totalDayArr[9], money[9],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'C#开发工程师',       numArr[10],  totalDayArr[10],money[10],  null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'前端开发工程师',     numArr[11],  totalDayArr[11],money[11],  null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'测试工程师',         numArr[12],  totalDayArr[12],money[12],  null],
        ], {origin: -1});

        sheet3Flag += (k != 0 ? 13 : 0);
        k++;
        sheet3['!merges'].push({s: {r: sheet3Flag, c: 1}, e: {r: sheet3Flag+13, c: 1}});
        sheet3['!merges'].push({s: {r: sheet3Flag, c: 2}, e: {r: sheet3Flag+12, c: 2}});
        sheet3['!merges'].push({s: {r: sheet3Flag, c: 3}, e: {r: sheet3Flag+12, c: 3}});
        sheet3['!merges'].push({s: {r: sheet3Flag, c: 4}, e: {r: sheet3Flag+12, c: 8}});
        sheet3['!merges'].push({s: {r: sheet3Flag, c: 9}, e: {r: sheet3Flag+12, c: 9}});
        for(var i = sheet3Flag+1; i <= sheet3Flag+13; i++){
            var n = "N"+i;
            var m = "M"+i;
            var o = "O"+i;
            sheet3[o] = { t:'n', f: n+'*'+m, F:o };
        }
        var OF1 = "O"+(sheet3Flag+1)
        var OF2 = "O"+(sheet3Flag+13)
        var sumF = 'SUM('+OF1+':'+OF2+')';
        sheet3['J'+(sheet3Flag+1)] = { t: 'n', f: sumF, F:'J'+(sheet3Flag+1)};

        var s6f = 0;
        var s6t = "";
        var s6FunMsg = "";
        var s6TempFlag = s6Flag;
        for(var i = 0; i < funNum; i++)
            s6FunMsg += funNameArr[i] + "（" + funMsgArr[i] + '）、';
        s6FunMsg = s6FunMsg.substr(0, s6FunMsg.length-1);
        if(jobArr.length != 0) {
            for(var i = 0; i < jobArr.length; i++) {
                if(numArr[i] != "" && totalDayArr[i] != null) {
                    console.log(jobArr[i]);
                    s6TempFlag++;
                    if(s6f == 0) {
                        s6f = 1;
                        XLSX.utils.sheet_add_aoa(sheet6, [
                            [null, projectName,  projectName, '客户端app', s6FunMsg, null, null, null, null, null, jobText[jobArr[i].site], jobArr[i].num, jobArr[i].totalDay, jobArr[i].money, null],
                        ], {origin: -1});
                    } else {
                        XLSX.utils.sheet_add_aoa(sheet6, [
                            [null, null,  null, null, null, null, null, null, null, null, jobText[jobArr[i].site], jobArr[i].num, jobArr[i].totalDay, jobArr[i].money, null],
                        ], {origin: -1});
                    }
                }
            }
        } else {
            XLSX.utils.sheet_add_aoa(sheet6, [
                [null, projectName,  projectName, '客户端app', s6FunMsg, null, null, null, null, null, null, null, null, null, null],], {origin: -1});
        }
        for(var i = s6Flag+1; i <= s6TempFlag+1; i++) {
            s6t += "O"+i+"+";
        }
        s6t = s6t.substr(0, s6t.length-1);
        sheet6['J'+(s6Flag+1)] = { t:'n', f: s6t, F:'J'+(s6Flag+1) };
        s6TempFlag = s6TempFlag != s6Flag ? s6TempFlag-1 : s6Flag;
        s6TotalT += "J"+(s6Flag+1)+"+";
        sheet6['!merges'].push({s: {r: s6Flag, c: 1},  e: {r: s6TempFlag+1, c: 1}});
        sheet6['!merges'].push({s: {r: s6Flag, c: 2},  e: {r: s6TempFlag+1, c: 2}});
        sheet6['!merges'].push({s: {r: s6Flag, c: 3},  e: {r: s6TempFlag, c: 3}});
        sheet6['!merges'].push({s: {r: s6Flag, c: 4},  e: {r: s6TempFlag, c: 8}});
        sheet6['!merges'].push({s: {r: s6Flag, c: 9},  e: {r: s6TempFlag, c: 9}});
        s6Flag = s6TempFlag+1;

        if(system2fun.s43.funNum != 0 && system2fun.s43.funNum != null) {
            var s4N = sheet4Flag;
            s4t += "+"+"K"+s4N;
            s4t2 += "+"+"L"+s4N;
            XLSX.utils.sheet_add_aoa(sheet4, [
                [null, projectName, "客户端app", funNameArr[0], funMsgArr[0], null, null, null, '套', null, systemTotalNum[5], null],
            ], {origin: -1});
            sheet4['!merges'].push({s: {r: sheet4Flag, c: 4},  e: {r: sheet4Flag, c: 5}});
            sheet4Flag++
            for(var i = 1; i < funNum; i++, sheet4Flag++) {
                XLSX.utils.sheet_add_aoa(sheet4, [
                    [null, null, null, funNameArr[i], funMsgArr[i], null, null, null, null, null, null, null],
                ], {origin: -1});
                sheet4['!merges'].push({s: {r: sheet4Flag, c: 4},  e: {r: sheet4Flag, c: 5}});
            }
            sheet4Flag--;
            sheet4['!merges'].push({s: {r: s4N, c: 1},  e: {r: sheet4Flag+1, c: 1}});
            sheet4['!merges'].push({s: {r: s4N, c: 2},  e: {r: sheet4Flag, c: 2}});
            sheet4['!merges'].push({s: {r: s4N, c: 6},  e: {r: sheet4Flag, c: 6}});
            sheet4['!merges'].push({s: {r: s4N, c: 7},  e: {r: sheet4Flag, c: 7}});
            sheet4['!merges'].push({s: {r: s4N, c: 8},  e: {r: sheet4Flag, c: 8}});
            sheet4['!merges'].push({s: {r: s4N, c: 9},  e: {r: sheet4Flag, c: 9}});
            sheet4['!merges'].push({s: {r: s4N, c: 10},  e: {r: sheet4Flag, c: 10}});
            sheet4['!merges'].push({s: {r: s4N, c: 11},  e: {r: sheet4Flag, c: 11}});
            sheet4Flag++

            var s5FunMsg = "";
            for(var i = 0; i < funNum; i++)
                s5FunMsg += funNameArr[i] + "（" + funMsgArr[i] + '）、';
            s5FunMsg = s5FunMsg.substr(0, s5FunMsg.length-1);
            XLSX.utils.sheet_add_aoa(sheet5, [
                [null, projectName, projectName, "客户端app", s5FunMsg, null, null, null, null],
            ], {origin: -1});
            sheet5['!merges'].push({s: {r: ++sheet5Flag, c: 4},  e: {r: sheet5Flag, c: 8}});
        }
    }

    if(flagArr[3] != 0) {
        funMsg = "";
        if(system2fun.s44.funNum != 0 && system2fun.s44.funNum != null) {
            funNameArr = system2fun.s44.funName.split('_');
            funNum = system2fun.s44.funNum;
            funMsgArr = system2fun.s44.funMsg.split('/');
            for(var i = 0; i < funNum; i++)
                funMsg += funNameArr[i] + ": " + funMsgArr[i] + '\n';
        }
        jobArr = system2job.s44;
        numArr = new Array();
        planDayArr = new Array();
        totalDayArr = new Array();
        money = new Array();
        if(system2job.s44.length != 0) {
            for(let i = 0; i < 13; i++) {
                numArr.push(jobArr[i].num != null ? jobArr[i].num : "");
                planDayArr.push(jobArr[i].planDay);
                totalDayArr.push(jobArr[i].totalDay);
                money.push(jobArr[i].money);
            }
        }
        XLSX.utils.sheet_add_aoa(sheet2, [
            [null, projectName, '应用层',  'PC应用',   funMsg,      null, null, '产品经理',          numArr[0],   planDayArr[0],  totalDayArr[0]],
            [null, null,        null,        null,     null,          null, null, '需求分析师',        numArr[1],   planDayArr[1],  totalDayArr[1]],
            [null, null,        null,        null,     null,          null, null, '应用架构设计师',    numArr[2],   planDayArr[2],  totalDayArr[2]],
            [null, null,        null,        null,     null,          null, null, '基础平台设计师',    numArr[3],   planDayArr[3],  totalDayArr[3]],
            [null, null,        null,        null,     null,         null, null, '客户端（app）设计师',numArr[4],   planDayArr[4],  totalDayArr[4]],
            [null, null,        null,        null,     null,          null, null, '前端设计设计师',    numArr[5],   planDayArr[5],  totalDayArr[5]],
            [null, null,        null,        null,     null,          null, null, 'UI设计师',          numArr[6],   planDayArr[6],  totalDayArr[6]],
            [null, null,        null,        null,     null,          null, null, 'java开发工程师',    numArr[7],   planDayArr[7],  totalDayArr[7]],
            [null, null,        null,        null,     null,          null, null, '安卓开发工程师',    numArr[8],   planDayArr[8],  totalDayArr[8]],
            [null, null,        null,        null,     null,          null, null, '苹果开发工程师',    numArr[9],   planDayArr[9],  totalDayArr[9]],
            [null, null,        null,        null,     null,          null, null, 'C#开发工程师',     numArr[10],  planDayArr[10], totalDayArr[10]],
            [null, null,        null,        null,     null,          null, null, '前端开发工程师',   numArr[11],  planDayArr[11], totalDayArr[11]],
            [null, null,        null,        null,     null,          null, null, '测试工程师',       numArr[12],  planDayArr[12], totalDayArr[12]]
        ], {origin: -1});
        detailsMsgFlag += (f != 1 ? 17 : 13);
        f = 1;
        sheet2['!merges'].push({s: {r: detailsMsgFlag, c: 4}, e: {r: detailsMsgFlag, c: 6}});
        sheet2['!merges'].push({s: {r: detailsMsgFlag, c: 1}, e: {r: detailsMsgFlag+13, c: 1}});
        sheet2['!merges'].push({s: {r: detailsMsgFlag+1, c: 2}, e: {r: detailsMsgFlag+13, c: 2}});
        sheet2['!merges'].push({s: {r: detailsMsgFlag+1, c: 3}, e: {r: detailsMsgFlag+13, c: 3}});
        sheet2['!merges'].push({s: {r: detailsMsgFlag+1, c: 4}, e: {r: detailsMsgFlag+13, c: 6}});

        XLSX.utils.sheet_add_aoa(sheet3, [
            [null, projectName, '应用层',  'PC端',   funMsg, null, null, null, null, null,'产品经理',      numArr[0],   totalDayArr[0], money[0],   null],
            [null, null,        null,    null,  null,   null, null, null, null, null,'需求分析师',         numArr[1],   totalDayArr[1], money[1],   null],
            [null, null,        null,    null,  null,   null, null, null, null, null,'应用架构设计师',     numArr[2],   totalDayArr[2], money[2],   null],
            [null, null,        null,    null,  null,   null, null, null, null, null,'基础平台设计师',     numArr[3],   totalDayArr[3], money[3],   null],
            [null, null,        null,    null,  null,   null, null, null, null, null,'客户端（app）设计师',numArr[4],   totalDayArr[4], money[4],   null],
            [null, null,        null,    null,  null,   null, null, null, null, null,'前端设计设计师',     numArr[5],   totalDayArr[5], money[5],   null],
            [null, null,        null,    null,  null,   null, null, null, null, null,'UI设计师',           numArr[6],   totalDayArr[6], money[6],   null],
            [null, null,        null,    null,  null,   null, null, null, null, null,'java开发工程师',     numArr[7],   totalDayArr[7], money[7],   null],
            [null, null,        null,    null,  null,   null, null, null, null, null,'安卓开发工程师',     numArr[8],   totalDayArr[8], money[8],   null],
            [null, null,        null,    null,  null,   null, null, null, null, null,'苹果开发工程师',     numArr[9],   totalDayArr[9], money[9],   null],
            [null, null,        null,    null,  null,   null, null, null, null, null,'C#开发工程师',       numArr[10],  totalDayArr[10],money[10],  null],
            [null, null,        null,    null,  null,   null, null, null, null, null,'前端开发工程师',     numArr[11],  totalDayArr[11],money[11],  null],
            [null, null,        null,    null,  null,   null, null, null, null, null,'测试工程师',         numArr[12],  totalDayArr[12],money[12],  null],
        ], {origin: -1});

        sheet3Flag += (k != 0 ? 13 : 0);
        k++;
        sheet3['!merges'].push({s: {r: sheet3Flag, c: 1}, e: {r: sheet3Flag+13, c: 1}});
        sheet3['!merges'].push({s: {r: sheet3Flag, c: 2}, e: {r: sheet3Flag+12, c: 2}});
        sheet3['!merges'].push({s: {r: sheet3Flag, c: 3}, e: {r: sheet3Flag+12, c: 3}});
        sheet3['!merges'].push({s: {r: sheet3Flag, c: 4}, e: {r: sheet3Flag+12, c: 8}});
        sheet3['!merges'].push({s: {r: sheet3Flag, c: 9}, e: {r: sheet3Flag+12, c: 9}});
        for(var i = sheet3Flag+1; i <= sheet3Flag+13; i++){
            var n = "N"+i;
            var m = "M"+i;
            var o = "O"+i;
            sheet3[o] = { t:'n', f: n+'*'+m, F:o };
        }
        var OF1 = "O"+(sheet3Flag+1)
        var OF2 = "O"+(sheet3Flag+13)
        var sumF = 'SUM('+OF1+':'+OF2+')';
        sheet3['J'+(sheet3Flag+1)] = { t: 'n', f: sumF, F:'J'+(sheet3Flag+1)};

        var s6f = 0;
        var s6t = "";
        var s6FunMsg = "";
        var s6TempFlag = s6Flag;
        for(var i = 0; i < funNum; i++)
            s6FunMsg += funNameArr[i] + "（" + funMsgArr[i] + '）、';
        s6FunMsg = s6FunMsg.substr(0, s6FunMsg.length-1);
        if(jobArr.length != 0) {
            for(var i = 0; i < jobArr.length; i++) {
                if(numArr[i] != "" && totalDayArr[i] != null) {
                    console.log(jobArr[i]);
                    s6TempFlag++;
                    if(s6f == 0) {
                        s6f = 1;
                        XLSX.utils.sheet_add_aoa(sheet6, [
                            [null, projectName,  projectName, 'PC端', s6FunMsg, null, null, null, null, null, jobText[jobArr[i].site], jobArr[i].num, jobArr[i].totalDay, jobArr[i].money, null],
                        ], {origin: -1});
                    } else {
                        XLSX.utils.sheet_add_aoa(sheet6, [
                            [null, null,  null, null, null, null, null, null, null, null, jobText[jobArr[i].site], jobArr[i].num, jobArr[i].totalDay, jobArr[i].money, null],
                        ], {origin: -1});
                    }
                }
            }
        } else {
            XLSX.utils.sheet_add_aoa(sheet6, [
                [null, projectName,  projectName, 'PC端', s6FunMsg, null, null, null, null, null, null, null, null, null, null],], {origin: -1});
        }
        for(var i = s6Flag+1; i <= s6TempFlag+1; i++) {
            s6t += "O"+i+"+";
        }
        s6t = s6t.substr(0, s6t.length-1);
        sheet6['J'+(s6Flag+1)] = { t:'n', f: s6t, F:'J'+(s6Flag+1) };
        s6TempFlag = s6TempFlag != s6Flag ? s6TempFlag-1 : s6Flag;
        s6TotalT += "J"+(s6Flag+1)+"+";
        sheet6['!merges'].push({s: {r: s6Flag, c: 1},  e: {r: s6TempFlag+1, c: 1}});
        sheet6['!merges'].push({s: {r: s6Flag, c: 2},  e: {r: s6TempFlag+1, c: 2}});
        sheet6['!merges'].push({s: {r: s6Flag, c: 3},  e: {r: s6TempFlag, c: 3}});
        sheet6['!merges'].push({s: {r: s6Flag, c: 4},  e: {r: s6TempFlag, c: 8}});
        sheet6['!merges'].push({s: {r: s6Flag, c: 9},  e: {r: s6TempFlag, c: 9}});
        s6Flag = s6TempFlag+1;

        if(system2fun.s44.funNum != 0 && system2fun.s44.funNum != null) {
            var s4N = sheet4Flag;
            s4t += "+"+"K"+s4N;
            s4t2 += "+"+"L"+s4N;
            XLSX.utils.sheet_add_aoa(sheet4, [
                [null, projectName, "PC端", funNameArr[0], funMsgArr[0], null, null, null, '套', null, systemTotalNum[6], null],
            ], {origin: -1});
            sheet4['!merges'].push({s: {r: sheet4Flag, c: 4},  e: {r: sheet4Flag, c: 5}});
            sheet4Flag++
            for(var i = 1; i < funNum; i++, sheet4Flag++) {
                XLSX.utils.sheet_add_aoa(sheet4, [
                    [null, null, null, funNameArr[i], funMsgArr[i], null, null, null, null, null, null, null],
                ], {origin: -1});
                sheet4['!merges'].push({s: {r: sheet4Flag, c: 4},  e: {r: sheet4Flag, c: 5}});
            }
            sheet4Flag--;
            sheet4['!merges'].push({s: {r: s4N, c: 1},  e: {r: sheet4Flag+1, c: 1}});
            sheet4['!merges'].push({s: {r: s4N, c: 2},  e: {r: sheet4Flag, c: 2}});
            sheet4['!merges'].push({s: {r: s4N, c: 6},  e: {r: sheet4Flag, c: 6}});
            sheet4['!merges'].push({s: {r: s4N, c: 7},  e: {r: sheet4Flag, c: 7}});
            sheet4['!merges'].push({s: {r: s4N, c: 8},  e: {r: sheet4Flag, c: 8}});
            sheet4['!merges'].push({s: {r: s4N, c: 9},  e: {r: sheet4Flag, c: 9}});
            sheet4['!merges'].push({s: {r: s4N, c: 10},  e: {r: sheet4Flag, c: 10}});
            sheet4['!merges'].push({s: {r: s4N, c: 11},  e: {r: sheet4Flag, c: 11}});
            sheet4Flag++

            var s5FunMsg = "";
            for(var i = 0; i < funNum; i++)
                s5FunMsg += funNameArr[i] + "（" + funMsgArr[i] + '）、';
            s5FunMsg = s5FunMsg.substr(0, s5FunMsg.length-1);
            XLSX.utils.sheet_add_aoa(sheet5, [
                [null, projectName, projectName, "PC应用", s5FunMsg, null, null, null, null],
            ], {origin: -1});
            sheet5['!merges'].push({s: {r: ++sheet5Flag, c: 4},  e: {r: sheet5Flag, c: 8}});
        }
    }

    if(flagArr[4] != 0) {
        funMsg = "";
        if(system2fun.s45.funNum != 0 && system2fun.s45.funNum != null) {
            funNameArr = system2fun.s45.funName.split('_');
            funNum = system2fun.s45.funNum;
            funMsgArr = system2fun.s45.funMsg.split('/');
            for(var i = 0; i < funNum; i++)
                funMsg += funNameArr[i] + ": " + funMsgArr[i] + '\n';
        }
        jobArr = system2job.s45;
        numArr = new Array();
        planDayArr = new Array();
        totalDayArr = new Array();
        money = new Array();
        if(system2job.s45.length != 0) {
            for(let i = 0; i < 13; i++) {
                numArr.push(jobArr[i].num != null ? jobArr[i].num : "");
                planDayArr.push(jobArr[i].planDay);
                totalDayArr.push(jobArr[i].totalDay);
                money.push(jobArr[i].money);
            }
        }
        XLSX.utils.sheet_add_aoa(sheet2, [
            [null, projectName, '应用层',  '公众号端',   funMsg,      null, null, '产品经理',          numArr[0],   planDayArr[0],  totalDayArr[0]],
            [null, null,        null,        null,     null,          null, null, '需求分析师',        numArr[1],   planDayArr[1],  totalDayArr[1]],
            [null, null,        null,        null,     null,          null, null, '应用架构设计师',    numArr[2],   planDayArr[2],  totalDayArr[2]],
            [null, null,        null,        null,     null,          null, null, '基础平台设计师',    numArr[3],   planDayArr[3],  totalDayArr[3]],
            [null, null,        null,        null,     null,         null, null, '客户端（app）设计师',numArr[4],   planDayArr[4],  totalDayArr[4]],
            [null, null,        null,        null,     null,          null, null, '前端设计设计师',    numArr[5],   planDayArr[5],  totalDayArr[5]],
            [null, null,        null,        null,     null,          null, null, 'UI设计师',          numArr[6],   planDayArr[6],  totalDayArr[6]],
            [null, null,        null,        null,     null,          null, null, 'java开发工程师',    numArr[7],   planDayArr[7],  totalDayArr[7]],
            [null, null,        null,        null,     null,          null, null, '安卓开发工程师',    numArr[8],   planDayArr[8],  totalDayArr[8]],
            [null, null,        null,        null,     null,          null, null, '苹果开发工程师',    numArr[9],   planDayArr[9],  totalDayArr[9]],
            [null, null,        null,        null,     null,          null, null, 'C#开发工程师',     numArr[10],  planDayArr[10], totalDayArr[10]],
            [null, null,        null,        null,     null,          null, null, '前端开发工程师',   numArr[11],  planDayArr[11], totalDayArr[11]],
            [null, null,        null,        null,     null,          null, null, '测试工程师',       numArr[12],  planDayArr[12], totalDayArr[12]]
        ], {origin: -1});
        detailsMsgFlag += (f != 1 ? 17 : 13);
        f = 1;
        sheet2['!merges'].push({s: {r: detailsMsgFlag, c: 4}, e: {r: detailsMsgFlag, c: 6}});
        sheet2['!merges'].push({s: {r: detailsMsgFlag, c: 1}, e: {r: detailsMsgFlag+13, c: 1}});
        sheet2['!merges'].push({s: {r: detailsMsgFlag+1, c: 2}, e: {r: detailsMsgFlag+13, c: 2}});
        sheet2['!merges'].push({s: {r: detailsMsgFlag+1, c: 3}, e: {r: detailsMsgFlag+13, c: 3}});
        sheet2['!merges'].push({s: {r: detailsMsgFlag+1, c: 4}, e: {r: detailsMsgFlag+13, c: 6}});

        XLSX.utils.sheet_add_aoa(sheet3, [
            [null, projectName, '应用层',  '公众号端',   funMsg, null, null, null, null, null,'产品经理', numArr[0],   totalDayArr[0], money[0],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'需求分析师',         numArr[1],   totalDayArr[1], money[1],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'应用架构设计师',     numArr[2],   totalDayArr[2], money[2],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'基础平台设计师',     numArr[3],   totalDayArr[3], money[3],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'客户端（app）设计师',numArr[4],   totalDayArr[4], money[4],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'前端设计设计师',     numArr[5],   totalDayArr[5], money[5],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'UI设计师',           numArr[6],   totalDayArr[6], money[6],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'java开发工程师',     numArr[7],   totalDayArr[7], money[7],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'安卓开发工程师',     numArr[8],   totalDayArr[8], money[8],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'苹果开发工程师',     numArr[9],   totalDayArr[9], money[9],   null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'C#开发工程师',       numArr[10],  totalDayArr[10],money[10],  null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'前端开发工程师',     numArr[11],  totalDayArr[11],money[11],  null],
            [null, null,        null,   null,  null,   null, null, null, null, null,'测试工程师',         numArr[12],  totalDayArr[12],money[12],  null],
        ], {origin: -1});

        sheet3Flag += (k != 0 ? 13 : 0);
        k++;
        sheet3['!merges'].push({s: {r: sheet3Flag, c: 1}, e: {r: sheet3Flag+13, c: 1}});
        sheet3['!merges'].push({s: {r: sheet3Flag, c: 2}, e: {r: sheet3Flag+12, c: 2}});
        sheet3['!merges'].push({s: {r: sheet3Flag, c: 3}, e: {r: sheet3Flag+12, c: 3}});
        sheet3['!merges'].push({s: {r: sheet3Flag, c: 4}, e: {r: sheet3Flag+12, c: 8}});
        sheet3['!merges'].push({s: {r: sheet3Flag, c: 9}, e: {r: sheet3Flag+12, c: 9}});
        for(var i = sheet3Flag+1; i <= sheet3Flag+13; i++){
            var n = "N"+i;
            var m = "M"+i;
            var o = "O"+i;
            sheet3[o] = { t:'n', f: n+'*'+m, F:o };
        }
        var OF1 = "O"+(sheet3Flag+1)
        var OF2 = "O"+(sheet3Flag+13)
        var sumF = 'SUM('+OF1+':'+OF2+')';
        sheet3['J'+(sheet3Flag+1)] = { t: 'n', f: sumF, F:'J'+(sheet3Flag+1)};

        var s6f = 0;
        var s6t = "";
        var s6FunMsg = "";
        var s6TempFlag = s6Flag;
        for(var i = 0; i < funNum; i++)
            s6FunMsg += funNameArr[i] + "（" + funMsgArr[i] + '）、';
        s6FunMsg = s6FunMsg.substr(0, s6FunMsg.length-1);
        if(jobArr.length != 0) {
            for(var i = 0; i < jobArr.length; i++) {
                if(numArr[i] != "" && totalDayArr[i] != null) {
                    console.log(jobArr[i]);
                    s6TempFlag++;
                    if(s6f == 0) {
                        s6f = 1;
                        XLSX.utils.sheet_add_aoa(sheet6, [
                            [null, projectName,  projectName, '公众号', s6FunMsg, null, null, null, null, null, jobText[jobArr[i].site], jobArr[i].num, jobArr[i].totalDay, jobArr[i].money, null],
                        ], {origin: -1});
                    } else {
                        XLSX.utils.sheet_add_aoa(sheet6, [
                            [null, null,  null, null, null, null, null, null, null, null, jobText[jobArr[i].site], jobArr[i].num, jobArr[i].totalDay, jobArr[i].money, null],
                        ], {origin: -1});
                    }
                }
            }
        } else {
            XLSX.utils.sheet_add_aoa(sheet6, [
                [null, projectName,  projectName, '公众号', s6FunMsg, null, null, null, null, null, null, null, null, null, null],], {origin: -1});
        }
        for(var i = s6Flag+1; i <= s6TempFlag+1; i++) {
            s6t += "O"+i+"+";
        }
        s6t = s6t.substr(0, s6t.length-1);
        sheet6['J'+(s6Flag+1)] = { t:'n', f: s6t, F:'J'+(s6Flag+1) };
        s6TempFlag = s6TempFlag != s6Flag ? s6TempFlag-1 : s6Flag;
        s6TotalT += "J"+(s6Flag+1)+"+";
        sheet6['!merges'].push({s: {r: s6Flag, c: 1},  e: {r: s6TempFlag+1, c: 1}});
        sheet6['!merges'].push({s: {r: s6Flag, c: 2},  e: {r: s6TempFlag+1, c: 2}});
        sheet6['!merges'].push({s: {r: s6Flag, c: 3},  e: {r: s6TempFlag, c: 3}});
        sheet6['!merges'].push({s: {r: s6Flag, c: 4},  e: {r: s6TempFlag, c: 8}});
        sheet6['!merges'].push({s: {r: s6Flag, c: 9},  e: {r: s6TempFlag, c: 9}});
        s6Flag = s6TempFlag+1;

        if(system2fun.s45.funNum != 0 && system2fun.s45.funNum != null) {
            var s4N = sheet4Flag;
            s4t += "+"+"K"+s4N;
            s4t2 += "+"+"L"+s4N;
            XLSX.utils.sheet_add_aoa(sheet4, [
                [null, projectName, "公众号", funNameArr[0], funMsgArr[0], null, null, null, '套', null, systemTotalNum[7], null],
            ], {origin: -1});
            sheet4['!merges'].push({s: {r: sheet4Flag, c: 4},  e: {r: sheet4Flag, c: 5}});
            sheet4Flag++
            for(var i = 1; i < funNum; i++, sheet4Flag++) {
                XLSX.utils.sheet_add_aoa(sheet4, [
                    [null, null, null, funNameArr[i], funMsgArr[i], null, null, null, null, null, null, null],
                ], {origin: -1});
                sheet4['!merges'].push({s: {r: sheet4Flag, c: 4},  e: {r: sheet4Flag, c: 5}});
            }
            sheet4Flag--;
            sheet4['!merges'].push({s: {r: s4N, c: 1},  e: {r: sheet4Flag+1, c: 1}});
            sheet4['!merges'].push({s: {r: s4N, c: 2},  e: {r: sheet4Flag, c: 2}});
            sheet4['!merges'].push({s: {r: s4N, c: 6},  e: {r: sheet4Flag, c: 6}});
            sheet4['!merges'].push({s: {r: s4N, c: 7},  e: {r: sheet4Flag, c: 7}});
            sheet4['!merges'].push({s: {r: s4N, c: 8},  e: {r: sheet4Flag, c: 8}});
            sheet4['!merges'].push({s: {r: s4N, c: 9},  e: {r: sheet4Flag, c: 9}});
            sheet4['!merges'].push({s: {r: s4N, c: 10},  e: {r: sheet4Flag, c: 10}});
            sheet4['!merges'].push({s: {r: s4N, c: 11},  e: {r: sheet4Flag, c: 11}});
            sheet4Flag++

            var s5FunMsg = "";
            for(var i = 0; i < funNum; i++)
                s5FunMsg += funNameArr[i] + "（" + funMsgArr[i] + '）、';
            s5FunMsg = s5FunMsg.substr(0, s5FunMsg.length-1);
            XLSX.utils.sheet_add_aoa(sheet5, [
                [null, projectName, projectName, "公众号", s5FunMsg, null, null, null, null],
            ], {origin: -1});
            sheet5['!merges'].push({s: {r: ++sheet5Flag, c: 4},  e: {r: sheet5Flag, c: 8}});
        }
    }

    funMsg = "";
    if(system2fun.s2.funNum != 0 && system2fun.s2.funNum != null) {
        funNameArr = system2fun.s2.funName.split('_');
        funNum = system2fun.s2.funNum;
        funMsgArr = system2fun.s2.funMsg.split('/');
        for(var i = 0; i < funNum; i++)
            funMsg += funNameArr[i] + ": " + funMsgArr[i] + '\n';
    }
    jobArr = system2job.s2;
    numArr = new Array();
    planDayArr = new Array();
    totalDayArr = new Array();
    money = new Array();
    if(system2job.s2.length != 0) {
        for(let i = 0; i < 13; i++) {
            numArr.push(jobArr[i].num != null ? jobArr[i].num : "");
            planDayArr.push(jobArr[i].planDay);
            totalDayArr.push(jobArr[i].totalDay);
            money.push(jobArr[i].money);
        }
    }
    XLSX.utils.sheet_add_aoa(sheet2, [
        [null, projectName, '接口层',  '应用API',    funMsg,      null, null, '产品经理',           numArr[0],   planDayArr[0],  totalDayArr[0]],
        [null, null,        null,        null,     null,          null, null, '需求分析师',         numArr[1],   planDayArr[1],  totalDayArr[1]],
        [null, null,        null,        null,     null,          null, null, '应用架构设计师',     numArr[2],   planDayArr[2],  totalDayArr[2]],
        [null, null,        null,        null,     null,          null, null, '基础平台设计师',     numArr[3],   planDayArr[3],  totalDayArr[3]],
        [null, null,        null,        null,     null,          null, null, '客户端（app）设计师',numArr[4],   planDayArr[4],  totalDayArr[4]],
        [null, null,        null,        null,     null,          null, null, '前端设计设计师',     numArr[5],   planDayArr[5],  totalDayArr[5]],
        [null, null,        null,        null,     null,          null, null, 'UI设计师',           numArr[6],   planDayArr[6],  totalDayArr[6]],
        [null, null,        null,        null,     null,          null, null, 'java开发工程师',     numArr[7],   planDayArr[7],  totalDayArr[7]],
        [null, null,        null,        null,     null,          null, null, '安卓开发工程师',     numArr[8],   planDayArr[8],  totalDayArr[8]],
        [null, null,        null,        null,     null,          null, null, '苹果开发工程师',     numArr[9],   planDayArr[9],  totalDayArr[9]],
        [null, null,        null,        null,     null,          null, null, 'C#开发工程师',       numArr[10],  planDayArr[10], totalDayArr[10]],
        [null, null,        null,        null,     null,          null, null, '前端开发工程师',     numArr[11],  planDayArr[11], totalDayArr[11]],
        [null, null,        null,        null,     null,          null, null, '测试工程师',         numArr[12],  planDayArr[12], totalDayArr[12]]
    ], {origin: -1});
    detailsMsgFlag += (f != 1 ? 17 : 13);
    f = 1;
    sheet2['!merges'].push({s: {r: detailsMsgFlag, c: 4}, e: {r: detailsMsgFlag, c: 6}});
    sheet2['!merges'].push({s: {r: detailsMsgFlag, c: 1}, e: {r: detailsMsgFlag+13, c: 1}});
    sheet2['!merges'].push({s: {r: detailsMsgFlag+1, c: 2}, e: {r: detailsMsgFlag+13, c: 2}});
    sheet2['!merges'].push({s: {r: detailsMsgFlag+1, c: 3}, e: {r: detailsMsgFlag+13, c: 3}});
    sheet2['!merges'].push({s: {r: detailsMsgFlag+1, c: 4}, e: {r: detailsMsgFlag+13, c: 6}});

    XLSX.utils.sheet_add_aoa(sheet3, [
        [null, projectName, '接口层',  '应用API',    funMsg, null, null, null, null, null,'产品经理',      numArr[0],   totalDayArr[0], money[0],   null],
        [null, null,        null,        null,  null,   null, null, null, null, null,'需求分析师',         numArr[1],   totalDayArr[1], money[1],   null],
        [null, null,        null,        null,  null,   null, null, null, null, null,'应用架构设计师',     numArr[2],   totalDayArr[2], money[2],   null],
        [null, null,        null,        null,  null,   null, null, null, null, null,'基础平台设计师',     numArr[3],   totalDayArr[3], money[3],   null],
        [null, null,        null,        null,  null,   null, null, null, null, null,'客户端（app）设计师',numArr[4],   totalDayArr[4], money[4],   null],
        [null, null,        null,        null,  null,   null, null, null, null, null,'前端设计设计师',     numArr[5],   totalDayArr[5], money[5],   null],
        [null, null,        null,        null,  null,   null, null, null, null, null,'UI设计师',           numArr[6],   totalDayArr[6], money[6],   null],
        [null, null,        null,        null,  null,   null, null, null, null, null,'java开发工程师',     numArr[7],   totalDayArr[7], money[7],   null],
        [null, null,        null,        null,  null,   null, null, null, null, null,'安卓开发工程师',     numArr[8],   totalDayArr[8], money[8],   null],
        [null, null,        null,        null,  null,   null, null, null, null, null,'苹果开发工程师',     numArr[9],   totalDayArr[9], money[9],   null],
        [null, null,        null,        null,  null,   null, null, null, null, null,'C#开发工程师',       numArr[10],  totalDayArr[10],money[10],  null],
        [null, null,        null,        null,  null,   null, null, null, null, null,'前端开发工程师',     numArr[11],  totalDayArr[11],money[11],  null],
        [null, null,        null,        null,  null,   null, null, null, null, null,'测试工程师',         numArr[12],  totalDayArr[12],money[12],  null],
    ], {origin: -1});

    sheet3Flag += (k != 0 ? 13 : 0);
    k++;
    sheet3['!merges'].push({s: {r: sheet3Flag, c: 1}, e: {r: sheet3Flag+13, c: 1}});
    sheet3['!merges'].push({s: {r: sheet3Flag, c: 2}, e: {r: sheet3Flag+12, c: 2}});
    sheet3['!merges'].push({s: {r: sheet3Flag, c: 3}, e: {r: sheet3Flag+12, c: 3}});
    sheet3['!merges'].push({s: {r: sheet3Flag, c: 4}, e: {r: sheet3Flag+12, c: 8}});
    sheet3['!merges'].push({s: {r: sheet3Flag, c: 9}, e: {r: sheet3Flag+12, c: 9}});
    for(var i = sheet3Flag+1; i <= sheet3Flag+13; i++){
        var n = "N"+i;
        var m = "M"+i;
        var o = "O"+i;
        sheet3[o] = { t:'n', f: n+'*'+m, F:o };
    }
    var OF1 = "O"+(sheet3Flag+1)
    var OF2 = "O"+(sheet3Flag+13)
    var sumF = 'SUM('+OF1+':'+OF2+')';
    sheet3['J'+(sheet3Flag+1)] = { t: 'n', f: sumF, F:'J'+(sheet3Flag+1)};

    var s6f = 0;
    var s6t = "";
    var s6FunMsg = "";
    var s6TempFlag = s6Flag;
    for(var i = 0; i < funNum; i++)
        s6FunMsg += funNameArr[i] + "（" + funMsgArr[i] + '）、';
    s6FunMsg = s6FunMsg.substr(0, s6FunMsg.length-1);
    if(jobArr.length != 0) {
        for(var i = 0; i < jobArr.length; i++) {
            if(numArr[i] != "" && totalDayArr[i] != null) {
                console.log(jobArr[i]);
                s6TempFlag++;
                if(s6f == 0) {
                    s6f = 1;
                    XLSX.utils.sheet_add_aoa(sheet6, [
                        [null, projectName,  projectName, '应用API', s6FunMsg, null, null, null, null, null, jobText[jobArr[i].site], jobArr[i].num, jobArr[i].totalDay, jobArr[i].money, null],
                    ], {origin: -1});
                } else {
                    XLSX.utils.sheet_add_aoa(sheet6, [
                        [null, null,  null, null, null, null, null, null, null, null, jobText[jobArr[i].site], jobArr[i].num, jobArr[i].totalDay, jobArr[i].money, null],
                    ], {origin: -1});
                }
            }
        }
    } else {
        XLSX.utils.sheet_add_aoa(sheet6, [
            [null, projectName,  projectName, '应用API', s6FunMsg, null, null, null, null, null, null, null, null, null, null],], {origin: -1});
    }
    for(var i = s6Flag+1; i <= s6TempFlag+1; i++) {
        s6t += "O"+i+"+";
    }
    s6t = s6t.substr(0, s6t.length-1);
    sheet6['J'+(s6Flag+1)] = { t:'n', f: s6t, F:'J'+(s6Flag+1) };
    s6TempFlag = s6TempFlag != s6Flag ? s6TempFlag-1 : s6Flag;
    s6TotalT += "J"+(s6Flag+1)+"+";
    sheet6['!merges'].push({s: {r: s6Flag, c: 1},  e: {r: s6TempFlag+1, c: 1}});
    sheet6['!merges'].push({s: {r: s6Flag, c: 2},  e: {r: s6TempFlag+1, c: 2}});
    sheet6['!merges'].push({s: {r: s6Flag, c: 3},  e: {r: s6TempFlag, c: 3}});
    sheet6['!merges'].push({s: {r: s6Flag, c: 4},  e: {r: s6TempFlag, c: 8}});
    sheet6['!merges'].push({s: {r: s6Flag, c: 9},  e: {r: s6TempFlag, c: 9}});
    s6Flag = s6TempFlag+1;

    if(system2fun.s2.funNum != 0 && system2fun.s2.funNum != null) {
        var s4N = sheet4Flag;
        s4t += "+"+"K"+s4N;
        s4t2 += "+"+"L"+s4N;
        XLSX.utils.sheet_add_aoa(sheet4, [
            [null, projectName, "应用API", funNameArr[0], funMsgArr[0], null, null, null, '套', null, systemTotalNum[1], null],
        ], {origin: -1});
        sheet4['!merges'].push({s: {r: sheet4Flag, c: 4},  e: {r: sheet4Flag, c: 5}});
        sheet4Flag++
        for(var i = 1; i < funNum; i++, sheet4Flag++) {
            XLSX.utils.sheet_add_aoa(sheet4, [
                [null, null, null, funNameArr[i], funMsgArr[i], null, null, null, null, null, null, null],
            ], {origin: -1});
            sheet4['!merges'].push({s: {r: sheet4Flag, c: 4},  e: {r: sheet4Flag, c: 5}});
        }
        sheet4Flag--;
        sheet4['!merges'].push({s: {r: s4N, c: 1},  e: {r: sheet4Flag+1, c: 1}});
        sheet4['!merges'].push({s: {r: s4N, c: 2},  e: {r: sheet4Flag, c: 2}});
        sheet4['!merges'].push({s: {r: s4N, c: 6},  e: {r: sheet4Flag, c: 6}});
        sheet4['!merges'].push({s: {r: s4N, c: 7},  e: {r: sheet4Flag, c: 7}});
        sheet4['!merges'].push({s: {r: s4N, c: 8},  e: {r: sheet4Flag, c: 8}});
        sheet4['!merges'].push({s: {r: s4N, c: 9},  e: {r: sheet4Flag, c: 9}});
        sheet4['!merges'].push({s: {r: s4N, c: 10},  e: {r: sheet4Flag, c: 10}});
        sheet4['!merges'].push({s: {r: s4N, c: 11},  e: {r: sheet4Flag, c: 11}});
        sheet4Flag++

        var s5FunMsg = "";
        for(var i = 0; i < funNum; i++)
            s5FunMsg += funNameArr[i] + "（" + funMsgArr[i] + '）、';
        s5FunMsg = s5FunMsg.substr(0, s5FunMsg.length-1);
        XLSX.utils.sheet_add_aoa(sheet5, [
            [null, projectName, projectName, "应用API", s5FunMsg, null, null, null, null],
        ], {origin: -1});
        sheet5['!merges'].push({s: {r: ++sheet5Flag, c: 4},  e: {r: sheet5Flag, c: 8}});
    }

    funMsg = "";
    if(system2fun.s3.funNum != 0 && system2fun.s3.funNum != null) {
        funNameArr = system2fun.s3.funName.split('_');
        funNum = system2fun.s3.funNum;
        funMsgArr = system2fun.s3.funMsg.split('/');
        for(var i = 0; i < funNum; i++)
            funMsg += funNameArr[i] + ": " + funMsgArr[i] + '\n';
    }
    jobArr = system2job.s3;
    numArr = new Array();
    planDayArr = new Array();
    totalDayArr = new Array();
    money = new Array();
    if(system2job.s3.length != 0) {
        for(let i = 0; i < 13; i++) {
            numArr.push(jobArr[i].num != null ? jobArr[i].num : "");
            planDayArr.push(jobArr[i].planDay);
            totalDayArr.push(jobArr[i].totalDay);
            money.push(jobArr[i].money);
        }
    }
    XLSX.utils.sheet_add_aoa(sheet2, [
        [null, projectName, '服务层',  '后台管理系统',   funMsg,  null, null, '产品经理',           numArr[0],   planDayArr[0],  totalDayArr[0]],
        [null, null,        null,        null,     null,          null, null, '需求分析师',         numArr[1],   planDayArr[1],  totalDayArr[1]],
        [null, null,        null,        null,     null,          null, null, '应用架构设计师',     numArr[2],   planDayArr[2],  totalDayArr[2]],
        [null, null,        null,        null,     null,          null, null, '基础平台设计师',     numArr[3],   planDayArr[3],  totalDayArr[3]],
        [null, null,        null,        null,     null,          null, null, '客户端（app）设计师',numArr[4],   planDayArr[4],  totalDayArr[4]],
        [null, null,        null,        null,     null,          null, null, '前端设计设计师',     numArr[5],   planDayArr[5],  totalDayArr[5]],
        [null, null,        null,        null,     null,          null, null, 'UI设计师',           numArr[6],   planDayArr[6],  totalDayArr[6]],
        [null, null,        null,        null,     null,          null, null, 'java开发工程师',     numArr[7],   planDayArr[7],  totalDayArr[7]],
        [null, null,        null,        null,     null,          null, null, '安卓开发工程师',     numArr[8],   planDayArr[8],  totalDayArr[8]],
        [null, null,        null,        null,     null,          null, null, '苹果开发工程师',     numArr[9],   planDayArr[9],  totalDayArr[9]],
        [null, null,        null,        null,     null,          null, null, 'C#开发工程师',       numArr[10],  planDayArr[10], totalDayArr[10]],
        [null, null,        null,        null,     null,          null, null, '前端开发工程师',     numArr[11],  planDayArr[11], totalDayArr[11]],
        [null, null,        null,        null,     null,          null, null, '测试工程师',         numArr[12],  planDayArr[12], totalDayArr[12]]
    ], {origin: -1});
    detailsMsgFlag += 13;
    sheet2['!merges'].push({s: {r: detailsMsgFlag, c: 4}, e: {r: detailsMsgFlag, c: 6}});
    sheet2['!merges'].push({s: {r: detailsMsgFlag, c: 1}, e: {r: detailsMsgFlag+13, c: 1}});
    sheet2['!merges'].push({s: {r: detailsMsgFlag+1, c: 2}, e: {r: detailsMsgFlag+13, c: 2}});
    sheet2['!merges'].push({s: {r: detailsMsgFlag+1, c: 3}, e: {r: detailsMsgFlag+13, c: 3}});
    sheet2['!merges'].push({s: {r: detailsMsgFlag+1, c: 4}, e: {r: detailsMsgFlag+13, c: 6}});

    XLSX.utils.sheet_add_aoa(sheet3, [
        [null, projectName, '服务层',  '后台管理系统',  funMsg, null, null, null, null, null,'产品经理',   numArr[0],   totalDayArr[0], money[0],   null],
        [null, null,        null,        null,  null,   null, null, null, null, null,'需求分析师',         numArr[1],   totalDayArr[1], money[1],   null],
        [null, null,        null,        null,  null,   null, null, null, null, null,'应用架构设计师',     numArr[2],   totalDayArr[2], money[2],   null],
        [null, null,        null,        null,  null,   null, null, null, null, null,'基础平台设计师',     numArr[3],   totalDayArr[3], money[3],   null],
        [null, null,        null,        null,  null,   null, null, null, null, null,'客户端（app）设计师',numArr[4],   totalDayArr[4], money[4],   null],
        [null, null,        null,        null,  null,   null, null, null, null, null,'前端设计设计师',     numArr[5],   totalDayArr[5], money[5],   null],
        [null, null,        null,        null,  null,   null, null, null, null, null,'UI设计师',           numArr[6],   totalDayArr[6], money[6],   null],
        [null, null,        null,        null,  null,   null, null, null, null, null,'java开发工程师',     numArr[7],   totalDayArr[7], money[7],   null],
        [null, null,        null,        null,  null,   null, null, null, null, null,'安卓开发工程师',     numArr[8],   totalDayArr[8], money[8],   null],
        [null, null,        null,        null,  null,   null, null, null, null, null,'苹果开发工程师',     numArr[9],   totalDayArr[9], money[9],   null],
        [null, null,        null,        null,  null,   null, null, null, null, null,'C#开发工程师',       numArr[10],  totalDayArr[10],money[10],  null],
        [null, null,        null,        null,  null,   null, null, null, null, null,'前端开发工程师',     numArr[11],  totalDayArr[11],money[11],  null],
        [null, null,        null,        null,  null,   null, null, null, null, null,'测试工程师',         numArr[12],  totalDayArr[12],money[12],  null],
        [null, "小计: ", null, null, null, null, null, null,null, null,  null,null, null, null, null, null, null],
        [null, null, null, null, null, null, null, null,null, null,  null,null, null, null, null, null, null],
        [null, "总计: ", null, null, null, null, null, null,null, null,  null,null, null, null, null, null, null],
    ], {origin: -1});

    sheet3Flag += (k != 0 ? 13 : 0);
    k++;
    sheet3['!merges'].push({s: {r: sheet3Flag, c: 1}, e: {r: sheet3Flag+12, c: 1}});
    sheet3['!merges'].push({s: {r: sheet3Flag, c: 2}, e: {r: sheet3Flag+12, c: 2}});
    sheet3['!merges'].push({s: {r: sheet3Flag, c: 3}, e: {r: sheet3Flag+12, c: 3}});
    sheet3['!merges'].push({s: {r: sheet3Flag, c: 4}, e: {r: sheet3Flag+12, c: 8}});
    sheet3['!merges'].push({s: {r: sheet3Flag, c: 9}, e: {r: sheet3Flag+12, c: 9}});
    sheet3['!merges'].push({s: {r: sheet3Flag+13, c: 1}, e: {r: sheet3Flag+13, c: 8}});
    sheet3['!merges'].push({s: {r: sheet3Flag+13, c: 10}, e: {r: sheet3Flag+13, c: 14}});
    sheet3['!merges'].push({s: {r: sheet3Flag+14, c: 1}, e: {r: sheet3Flag+14, c: 14}});
    sheet3['!merges'].push({s: {r: sheet3Flag+15, c: 1}, e: {r: sheet3Flag+15, c: 8}});
    sheet3['!merges'].push({s: {r: sheet3Flag+15, c: 10}, e: {r: sheet3Flag+15, c: 14}});

    var s6f = 0;
    var s6t = "";
    var s6FunMsg = "";
    var s6TempFlag = s6Flag;
    for(var i = 0; i < funNum; i++)
        s6FunMsg += funNameArr[i] + "（" + funMsgArr[i] + '）、';
    s6FunMsg = s6FunMsg.substr(0, s6FunMsg.length-1);
    if(jobArr.length != 0) {
        for(var i = 0; i < jobArr.length; i++) {
            if(numArr[i] != "" && totalDayArr[i] != null) {
                console.log(jobArr[i]);
                s6TempFlag++;
                if(s6f == 0) {
                    s6f = 1;
                    XLSX.utils.sheet_add_aoa(sheet6, [
                        [null, projectName,  projectName, '后台管理系统', s6FunMsg, null, null, null, null, null, jobText[jobArr[i].site], jobArr[i].num, jobArr[i].totalDay, jobArr[i].money, null],
                    ], {origin: -1});
                } else {
                    XLSX.utils.sheet_add_aoa(sheet6, [
                        [null, null,  null, null, null, null, null, null, null, null, jobText[jobArr[i].site], jobArr[i].num, jobArr[i].totalDay, jobArr[i].money, null],
                    ], {origin: -1});
                }
            }
        }
    } else {
        XLSX.utils.sheet_add_aoa(sheet6, [
            [null, projectName,  projectName, '后台管理系统', s6FunMsg, null, null, null, null, null, null, null, null, null, null],], {origin: -1});
    }
    for(var i = s6Flag+1; i <= s6TempFlag+1; i++) {
        s6t += "O"+i+"+";
    }
    s6t = s6t.substr(0, s6t.length-1);
    sheet6['J'+(s6Flag+1)] = { t:'n', f: s6t, F:'J'+(s6Flag+1) };
    s6TempFlag = s6TempFlag != s6Flag ? s6TempFlag-1 : s6Flag;
    sheet6['!merges'].push({s: {r: s6Flag, c: 1},  e: {r: s6TempFlag, c: 1}});
    sheet6['!merges'].push({s: {r: s6Flag, c: 2},  e: {r: s6TempFlag, c: 2}});
    sheet6['!merges'].push({s: {r: s6Flag, c: 3},  e: {r: s6TempFlag, c: 3}});
    sheet6['!merges'].push({s: {r: s6Flag, c: 4},  e: {r: s6TempFlag, c: 8}});
    sheet6['!merges'].push({s: {r: s6Flag, c: 9},  e: {r: s6TempFlag, c: 9}});
    s6Flag = s6TempFlag+1;

    if(system2fun.s3.funNum != 0 && system2fun.s3.funNum != null) {
        var s4N = sheet4Flag;
        s4t += "+"+"K"+s4N;
        s4t2 += "+"+"L"+s4N;
        XLSX.utils.sheet_add_aoa(sheet4, [
            [null, projectName, "后台管理系统", funNameArr[0], funMsgArr[0], null, null, null, '套', null, systemTotalNum[2], null],
        ], {origin: -1});
        sheet4['!merges'].push({s: {r: sheet4Flag, c: 4},  e: {r: sheet4Flag, c: 5}});
        sheet4Flag++
        for(var i = 1; i < funNum; i++, sheet4Flag++) {
            XLSX.utils.sheet_add_aoa(sheet4, [
                [null, null, null, funNameArr[i], funMsgArr[i], null, null, null, null, null, null, null],
            ], {origin: -1});
            sheet4['!merges'].push({s: {r: sheet4Flag, c: 4},  e: {r: sheet4Flag, c: 5}});
        }
        sheet4Flag--;
        sheet4['!merges'].push({s: {r: s4N, c: 1},  e: {r: sheet4Flag, c: 1}});
        sheet4['!merges'].push({s: {r: s4N, c: 2},  e: {r: sheet4Flag, c: 2}});
        sheet4['!merges'].push({s: {r: s4N, c: 6},  e: {r: sheet4Flag, c: 6}});
        sheet4['!merges'].push({s: {r: s4N, c: 7},  e: {r: sheet4Flag, c: 7}});
        sheet4['!merges'].push({s: {r: s4N, c: 8},  e: {r: sheet4Flag, c: 8}});
        sheet4['!merges'].push({s: {r: s4N, c: 9},  e: {r: sheet4Flag, c: 9}});
        sheet4['!merges'].push({s: {r: s4N, c: 10},  e: {r: sheet4Flag, c: 10}});
        sheet4['!merges'].push({s: {r: s4N, c: 11},  e: {r: sheet4Flag, c: 11}});
        sheet4Flag++
        XLSX.utils.sheet_add_aoa(sheet4, [
            [null, "小计", null, null, null, null, null, null, null, null, null, null],
        ], {origin: -1});
        sheet4['!merges'].push({s: {r: sheet4Flag, c: 1},  e: {r: sheet4Flag, c: 10}});

        var s5FunMsg = "";
        for(var i = 0; i < funNum; i++)
            s5FunMsg += funNameArr[i] + "（" + funMsgArr[i] + '）、';
        s5FunMsg = s5FunMsg.substr(0, s5FunMsg.length-1);
        XLSX.utils.sheet_add_aoa(sheet5, [
            [null, projectName, projectName, "后台管理系统", s5FunMsg, null, null, null, null],
        ], {origin: -1});
        sheet5['!merges'].push({s: {r: ++sheet5Flag, c: 4},  e: {r: sheet5Flag, c: 8}});
    }

    sheet4['K4'] = { t:'n', f: s4t, F:'K4'};
    sheet4['L'+(sheet4Flag+1)] = { t:'n', f: s4t2, F:'L'+(sheet4Flag+1)};

    for(var i = sheet3Flag+1; i <= sheet3Flag+13; i++){
        var n = "N"+i;
        var m = "M"+i;
        var o = "O"+i;
        sheet3[o] = { t:'n', f: n+'*'+m, F:o };
    }

    var s3t = "J"+22;
    for(var i = 1, num=35; i < k; i++, num+=13) {
        s3t += "+"+"J"+num;
    }
    sheet3['J'+(sheet3Flag+14)] = { t:'n', f: s3t, F:'J'+(sheet3Flag+14) };
    s3t += "+"+"J"+19;
    sheet3['J'+(sheet3Flag+16)] = { t:'n', f: s3t, F:'J'+(sheet3Flag+16) };

    for(var i = 6; i <= s6TempFlag+1; i++){
        var n = "N"+i;
        var m = "M"+i;
        var o = "O"+i;
        sheet6[o] = { t:'n', f: n+'*'+m, F:o };
    }

    s6TotalT = s6TotalT.substr(0, s6TotalT.length-1);
    sheet6['J'+(s6Flag+1)] = { t:'n', f: s6TotalT, F:'J'+(s6Flag+1) };
    sheet6['J'+(s6Flag+3)] = { t:'n', f: s6TotalT, F:'J'+(s6Flag+3) };

    XLSX.utils.sheet_add_aoa(sheet6, [
        [null, "小计: ", null, null, null, null, null, null,null, null,  null,null, null, null, null, null, null],
        [null, null, null, null, null, null, null, null,null, null,  null,null, null, null, null, null, null],
        [null, "总计: ", null, null, null, null, null, null,null, null,  null,null, null, null, null, null, null],
    ], {origin: -1});

    sheet6['!merges'].push({s: {r: s6Flag, c: 1}, e: {r: s6Flag, c: 8}});
    sheet6['!merges'].push({s: {r: s6Flag, c: 10}, e: {r: s6Flag, c: 14}});
    sheet6['!merges'].push({s: {r: s6Flag+1, c: 1}, e: {r: s6Flag+1, c: 14}});
    sheet6['!merges'].push({s: {r: s6Flag+2, c: 1}, e: {r: s6Flag+2, c: 8}});
    sheet6['!merges'].push({s: {r: s6Flag+2, c: 10}, e: {r: s6Flag+2, c: 14}});




    sheet2['!cols'] = [
        {wpx: 60},
        {wpx: 54},
        {wpx: 60},
        {wpx: 78},
        {wpx: 30},
        {wpx: 48},
        {wpx: 174},
        {wpx: 144},
        {wpx: 90},
        {wpx: 90},
        {wpx: 102}
    ];

    sheet3['!cols'] = [
        {wpx: 60},
        {wpx: 50},
        {wpx: 50},
        {wpx: 72},
        {wpx: 50},
        {wpx: 50},
        {wpx: 50},
        {wpx: 70},
        {wpx: 36},
        {wpx: 50},
        {wpx: 120},
        {wpx: 50},
        {wpx: 50},
        {wpx: 50},
        {wpx: 50}
    ];
    sheet4['!cols'] = [
        {wpx: 60},
        {wpx: 100},
        {wpx: 90},
        {wpx: 96},
        {wpx: 40},
        {wpx: 180},
        {wpx: 50},
        {wpx: 50},
        {wpx: 50},
        {wpx: 50},
        {wpx: 50},
        {wpx: 50}
    ];
    sheet5['!cols'] = [
        {wpx: 60},
        {wpx: 50},
        {wpx: 55},
        {wpx: 100},
        {wpx: 120},
        {wpx: 50},
        {wpx: 50},
        {wpx: 50},
        {wpx: 50}
    ];
    sheet6['!cols'] = [
        {wpx: 60},
        {wpx: 90},
        {wpx: 90},
        {wpx: 84},
        {wpx: 45},
        {wpx: 45},
        {wpx: 45},
        {wpx: 45},
        {wpx: 45},
        {wpx: 63},
        {wpx: 130},
        {wpx: 50},
        {wpx: 50},
        {wpx: 50},
        {wpx: 50}
    ];
    var urlArr = new Array();
    var nameArr = new Array();
    urlArr.push(sheet2blob(sheet2))
    urlArr.push(sheet2blob(sheet3))
    urlArr.push(sheet2blob(sheet4))
    urlArr.push(sheet2blob(sheet5))
    urlArr.push(sheet2blob(sheet6))
    nameArr.push('项目交付物及报价明细.xlsx');
    nameArr.push('报价明细单(对内).xlsx');
    nameArr.push('技术研发报价单.xlsx');
    nameArr.push('报价明细单(面向客户).xlsx');
    nameArr.push('软件采购(面向客户).xlsx');
    openDownloadDialogArr(urlArr, nameArr);
    //openDownloadDialog(sheet2blob(sheet2), '项目交付物及报价明细.xlsx');
    //openDownloadDialog(sheet2blob(sheet3), '报价明细单(对内).xlsx');
    //openDownloadDialog(sheet2blob(sheet5), '技术研发报价单.xlsx');
    //openDownloadDialog(sheet2blob(sheet6), '报价明细单(面向客户).xlsx');
    //openDownloadDialog(sheet2blob(sheet4), '软件采购(面向客户).xlsx');
}
